Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RunWith(SpringJUnit4ClassRunner.class)
- @ContextConfiguration
- public class BaseTest {
- @Autowired
- MyComponent myComponent;
- @Configuration
- @Import(MyComponentBaseConfiguration.class)
- static class Cfg {
- @Bean
- MyComponent myComponent() {
- return new MyComponent();
- }
- }
- void convert(MyComponentInterface component) {
- // here component is null
- }
- @Test
- public void test() {
- BaseTestChild child = new BaseTestChild();
- child.test();
- }
- }
- @RunWith(SpringJUnit4ClassRunner.class)
- @FixMethodOrder(MethodSorters.NAME_ASCENDING)
- public class BaseTestChild extends BaseTest {
- @Test
- public void test() {
- convert(myComponent); // here myComponent is null
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement