在我的测试类中,我使用@mockbean注释
@MockBean
SOAPConnector soapConnector;
bean soapConnector工作正常是我的开发但它在测试环境中给了我bean创建异常。
使用名称' soapConnector'创建bean时出错:init方法的调用失败;嵌套异常是java.lang.NullPointerException
以下是bean定义
@Bean(name="soapConnector")
public SOAPConnector soapConnector(Jaxb2Marshaller marshaller) {
SOAPConnector client = new SOAPConnector();
client.setDefaultUri("https://ms.cross-
check.com/ProcessCheck/ProcessCheckSoapImpl.wsdl");
client.setMarshaller(marshaller);
client.setUnmarshaller(marshaller);
return client;
}