Last active
December 1, 2016 07:43
-
-
Save aVolpe/7047488 to your computer and use it in GitHub Desktop.
RegisterServicesTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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