Skip to content

Instantly share code, notes, and snippets.

@aVolpe
Last active December 1, 2016 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aVolpe/7047488 to your computer and use it in GitHub Desktop.
Save aVolpe/7047488 to your computer and use it in GitHub Desktop.
RegisterServicesTest.java
@ContextConfiguration(loader = AnnotationConfigContextLoader.class)
public class RegisterServicesTest extends BaseTest {
@Configuration
static class ContextConfiguration extends BaseTestConfiguration {
@Bean
public ServiceDefinitionRegister serviceDefinitionRegister() {
return new ServiceDefinitionRegister();
}
@Bean
public TestEndPoint testEndPoint() {
return new TestEndPoint();
}
@Bean
public TestBean testBean() {
return new TestBean();
}
}
@Autowired
TestEndPoint testEndPoint;
@Autowired
TestBean testBean;
@Test
public void testRegister() {
Map<String, DefaultWsdl11Definition> map = applicationContext
.getBeansOfType(DefaultWsdl11Definition.class);
assertNotNull(testEndPoint.testBean); // when use getBeansWithAnnotation fail here
assertTrue(map.containsKey("test")); // when comment the entire BeanFactoryPostProcessor fails here
// this will pass if the previus assert doesn't exits, and the
// BeanFactoryPostProcessor is enabled!.
DefaultWsdl11Definition dw11Definition = map.get("test");
}
@Component
@WebService(xsds = { "/META-INF/schemas/karaku/menu/menu.xsd" })
public static class TestEndPoint {
@Autowired(required = true)
TestBean testBean;
}
public static class TestBean {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment