diff --git a/spring-core-5/src/main/java/com/baeldung/springbean/naming/component/Cat.java b/spring-core-5/src/main/java/com/baeldung/springbean/naming/component/Cat.java index a3791ddf60..8c70078822 100644 --- a/spring-core-5/src/main/java/com/baeldung/springbean/naming/component/Cat.java +++ b/spring-core-5/src/main/java/com/baeldung/springbean/naming/component/Cat.java @@ -5,7 +5,7 @@ import org.springframework.stereotype.Component; @Component @Qualifier("cat") -public class Cat implements Animal{ +public class Cat implements Animal { @Override public String name() { diff --git a/spring-core-5/src/main/java/com/baeldung/springbean/naming/service/MessagingServiceImpl.java b/spring-core-5/src/main/java/com/baeldung/springbean/naming/service/MessagingServiceImpl.java index ec2972dfef..2b7cb84742 100644 --- a/spring-core-5/src/main/java/com/baeldung/springbean/naming/service/MessagingServiceImpl.java +++ b/spring-core-5/src/main/java/com/baeldung/springbean/naming/service/MessagingServiceImpl.java @@ -6,7 +6,7 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; @Service -public class MessagingServiceImpl implements MessagingService{ +public class MessagingServiceImpl implements MessagingService { @Autowired @Qualifier("qualifierComponent") diff --git a/spring-core-5/src/test/java/com/baeldung/springbean/naming/SpringBeanNamingTest.java b/spring-core-5/src/test/java/com/baeldung/springbean/naming/SpringBeanNamingUnitTest.java similarity index 77% rename from spring-core-5/src/test/java/com/baeldung/springbean/naming/SpringBeanNamingTest.java rename to spring-core-5/src/test/java/com/baeldung/springbean/naming/SpringBeanNamingUnitTest.java index 66503f7c26..a942897cdd 100644 --- a/spring-core-5/src/test/java/com/baeldung/springbean/naming/SpringBeanNamingTest.java +++ b/spring-core-5/src/test/java/com/baeldung/springbean/naming/SpringBeanNamingUnitTest.java @@ -13,7 +13,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertNotNull; @ExtendWith(SpringExtension.class) -public class SpringBeanNamingTest { +public class SpringBeanNamingUnitTest { private AnnotationConfigApplicationContext context; @@ -24,29 +24,29 @@ public class SpringBeanNamingTest { context.refresh(); } - // 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 + // 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 givenLoggingServiceBeanIsCreated_whenThereIsNoValueProvided_thenBeanNameShouldBeDefaultName() { assertNotNull(context.getBean("loggingService")); } - // In this case, to name a bean spring gets the class name and converts the first letter to lowercase. + // In this case, to name a bean spring gets the class name and converts the first letter to lowercase. @Test void givenAuditServiceBeanIsCreatedWithMethodLevelAnnotation_whenThereIsNoValueProvided_thenBeanNameShouldBeTheNameOfMethod() { 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 + // 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. + // 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 void givenCustomComponentBeanIsCreate_whenThereIsCustomNameGivenToBean_thenBeanShouldBeIdentifiedByThatName() { assertNotNull(context.getBean("myBean"));