我正在尝试测试一个依赖于bean来工作的类,我想模拟它。这个bean需要一个字符串值,它是使用@ConfigurationProperties从我的application.yml文件中接收的,这很可能是问题所在,因为在同一测试类中模拟的其他bean工作得很好@ConfigurationProperties("some_api") private String u
我正在测试一个Micronaut类,这个类中注入了一个bean。在我的测试中,我提供了一个@MockBean类来覆盖它。然而,似乎Micronaut仍然注入了真正的依赖。真正的依赖抛出一个异常,测试也会抛出异常。因为我的@MockBean,我没想到会发生这种事。如果我将注释更改为@MockBean(Dependency.class),则会得到以下错误:Message: No bean of type [di.failure.examp
问题是,数据类有一个主构造函数,并且是不可变的,并且micronaut试图将值作为bean注入。val notificationUrl: String,
错误:Caused by: io.micronaut.context.exceptions.NoSuchBeanException: No bean of type [java.lang.String] e
无法将AWS上下文注入MicronautRequestHandler{
"errorMessage": "No bean of type [com.amazonaws.services.lambda.runtime.Context] existsMake sure the bean is not disabled by bean
我无法通过Gradle任务注入依赖项 我的build.gradle task runDataFeeder(type:JavaExec){
classpath = sourceSets.main.runtimeClasspathMake sure the bean is not disabled by bean requirements (enable trace logging for 'io.micronaut.context.conditionMake sure the be