diff --git a/spring-core-5/src/main/java/com/baeldung/springbean/naming/gateway/LoggingGateway.java b/spring-core-5/src/main/java/com/baeldung/springbean/naming/gateway/LoggingGateway.java deleted file mode 100644 index f2157a5eeb..0000000000 --- a/spring-core-5/src/main/java/com/baeldung/springbean/naming/gateway/LoggingGateway.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.baeldung.springbean.naming.gateway; - -import org.springframework.stereotype.Service; - -@Service -public class LoggingGateway { -} diff --git a/spring-core-5/src/main/java/com/baeldung/springbean/naming/service/LoggingService.java b/spring-core-5/src/main/java/com/baeldung/springbean/naming/service/LoggingService.java index 9276706f7f..3be4e9a028 100644 --- a/spring-core-5/src/main/java/com/baeldung/springbean/naming/service/LoggingService.java +++ b/spring-core-5/src/main/java/com/baeldung/springbean/naming/service/LoggingService.java @@ -1,12 +1,7 @@ package com.baeldung.springbean.naming.service; -import com.baeldung.springbean.naming.gateway.LoggingGateway; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class LoggingService { - - @Autowired - private LoggingGateway gateway; } diff --git a/spring-core-5/src/test/java/com/baeldung/springbean/naming/SpringBeanNamingUnitTest.java b/spring-core-5/src/test/java/com/baeldung/springbean/naming/SpringBeanNamingUnitTest.java index a942897cdd..cccfe22e34 100644 --- a/spring-core-5/src/test/java/com/baeldung/springbean/naming/SpringBeanNamingUnitTest.java +++ b/spring-core-5/src/test/java/com/baeldung/springbean/naming/SpringBeanNamingUnitTest.java @@ -38,13 +38,6 @@ public class SpringBeanNamingUnitTest { assertNotNull(context.getBean("audit")); } - // To name a bean spring gets the class name and converts the first letter to lowercase. - // Default naming strategy of the spring bean which is using class level annotation - @Test - void givenLoggingGatewayBeanIsCreatedWithFieldLevelAnnotation_whenThereIsNoValueProvided_thenBeanNameShouldBeDefaultName() { - assertNotNull(context.getBean("loggingGateway")); - } - // spring will create the bean of type CustomComponent with the name "myBean". // As we're explicitly giving the name to the bean, spring will use this name to refer to it. @Test