【发布时间】:2019-06-14 19:31:35
【问题描述】:
@RunWith(SpringRunner.class)
@SpringBootTest
public class BankMainAppTest {
/**
* Test App load without throwing an exception.
*/
@Test
public void contextLoads() {
}//pass
@Test
public void applicationStarts() {
BankMainApp.main(new String[] {});
}//fail throw exception given below..
}
java.lang.IllegalArgumentException:无法实例化工厂类: org.springframework.boot.env.EnvironmentPostProcessor
【问题讨论】:
-
您为什么要这样做?如果应用程序运行,可以说它的 main 方法有效
-
@Stultuske 根据发布的代码,可能是为了覆盖(我同意这不是公平的理由)。
标签: java spring-boot