spring exceptions now have their own project - these no longer belong
This commit is contained in:
parent
76351a44ea
commit
fd6fb97343
@ -1,12 +0,0 @@
|
|||||||
package org.baeldung.ex.nosuchbeandefinitionexception.cause1;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class BeanA {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private BeanB dependency;
|
|
||||||
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
package org.baeldung.ex.nosuchbeandefinitionexception.cause1;
|
|
||||||
|
|
||||||
public class BeanB {
|
|
||||||
//
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
package org.baeldung.ex.nosuchbeandefinitionexception.cause2;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class BeanA {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IBeanB dependency;
|
|
||||||
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
package org.baeldung.ex.nosuchbeandefinitionexception.cause2;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class BeanB1 implements IBeanB {
|
|
||||||
//
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
package org.baeldung.ex.nosuchbeandefinitionexception.cause2;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class BeanB2 implements IBeanB {
|
|
||||||
//
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
package org.baeldung.ex.nosuchbeandefinitionexception.cause2;
|
|
||||||
|
|
||||||
public interface IBeanB {
|
|
||||||
//
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
package org.baeldung.ex.nosuchbeandefinitionexception.cause3;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class BeanA implements InitializingBean {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ApplicationContext context;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void afterPropertiesSet() {
|
|
||||||
context.getBean("someBeanName");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
package org.baeldung.ex.nosuchbeandefinitionexception.spring;
|
|
||||||
|
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@ComponentScan("org.baeldung.ex.nosuchbeandefinitionexception.cause1")
|
|
||||||
public class Cause1ContextWithJavaConfig {
|
|
||||||
|
|
||||||
public Cause1ContextWithJavaConfig() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
// beans
|
|
||||||
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
package org.baeldung.ex.nosuchbeandefinitionexception.spring;
|
|
||||||
|
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@ComponentScan("org.baeldung.ex.nosuchbeandefinitionexception.cause2")
|
|
||||||
public class Cause2ContextWithJavaConfig {
|
|
||||||
|
|
||||||
public Cause2ContextWithJavaConfig() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
// beans
|
|
||||||
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
package org.baeldung.ex.nosuchbeandefinitionexception.spring;
|
|
||||||
|
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@ComponentScan("org.baeldung.ex.nosuchbeandefinitionexception.cause3")
|
|
||||||
public class Cause3ContextWithJavaConfig {
|
|
||||||
|
|
||||||
public Cause3ContextWithJavaConfig() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
// beans
|
|
||||||
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
package org.baeldung.ex.nosuchbeandefinitionexception;
|
|
||||||
|
|
||||||
import org.baeldung.ex.nosuchbeandefinitionexception.spring.Cause1ContextWithJavaConfig;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
|
||||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|
||||||
import org.springframework.test.context.support.AnnotationConfigContextLoader;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration(classes = { Cause1ContextWithJavaConfig.class }, loader = AnnotationConfigContextLoader.class)
|
|
||||||
public class Cause1NoSuchBeanDefinitionExceptionIntegrationTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public final void givenContextIsInitialized_thenNoException() {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
package org.baeldung.ex.nosuchbeandefinitionexception;
|
|
||||||
|
|
||||||
import org.baeldung.ex.nosuchbeandefinitionexception.spring.Cause2ContextWithJavaConfig;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
|
||||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|
||||||
import org.springframework.test.context.support.AnnotationConfigContextLoader;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration(classes = { Cause2ContextWithJavaConfig.class }, loader = AnnotationConfigContextLoader.class)
|
|
||||||
public class Cause2NoSuchBeanDefinitionExceptionIntegrationTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public final void givenContextIsInitialized_thenNoException() {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
package org.baeldung.ex.nosuchbeandefinitionexception;
|
|
||||||
|
|
||||||
import org.baeldung.ex.nosuchbeandefinitionexception.spring.Cause3ContextWithJavaConfig;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
|
||||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|
||||||
import org.springframework.test.context.support.AnnotationConfigContextLoader;
|
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
|
||||||
@ContextConfiguration(classes = { Cause3ContextWithJavaConfig.class }, loader = AnnotationConfigContextLoader.class)
|
|
||||||
public class Cause3NoSuchBeanDefinitionExceptionIntegrationTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public final void givenContextIsInitialized_thenNoException() {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user