Merge pull request #7920 from kumar-devender/master

rename test cases to follow BDD style
This commit is contained in:
maibin 2019-10-02 09:42:57 -07:00 committed by GitHub
commit 25023df560
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 6 deletions

View File

@ -19,7 +19,7 @@ import static org.hamcrest.CoreMatchers.*;
public class ComponentScanAnnotationFilterAppIntegrationTest {
@Test
public void testBean() {
public void whenAnnotationFilterIsUsed_thenComponentScanShouldRegisterBeanAnnotatedWithAnimalAnootation() {
ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ComponentScanAnnotationFilterApp.class);
List<String> beans = Arrays.stream(applicationContext.getBeanDefinitionNames())
.filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanAnnotationFilterApp"))

View File

@ -19,10 +19,10 @@ import static org.hamcrest.CoreMatchers.*;
public class ComponentScanAspectJFilterAppIntegrationTest {
@Test
public void testBean() {
public void whenAspectJFilterIsUsed_thenComponentScanShouldRegisterBeanMatchingAspectJCreteria() {
ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ComponentScanAspectJFilterApp.class);
List<String> beans = Arrays.stream(applicationContext.getBeanDefinitionNames())
.filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanCustomFilterApp"))
.filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanAspectJFilterApp"))
.collect(Collectors.toList());
assertThat(beans.size(), equalTo(1));
assertThat(beans.get(0), equalTo("elephant"));

View File

@ -19,7 +19,7 @@ import static org.hamcrest.CoreMatchers.*;
public class ComponentScanAssignableTypeFilterAppIntegrationTest {
@Test
public void testBean() {
public void whenAssignableTypeFilterIsUsed_thenComponentScanShouldRegisterBeanOfAssignableTypeAndItsSubClass() {
ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ComponentScanAssignableTypeFilterApp.class);
List<String> beans = Arrays.stream(applicationContext.getBeanDefinitionNames())
.filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanAssignableTypeFilterApp"))

View File

@ -19,7 +19,7 @@ import static org.hamcrest.CoreMatchers.*;
public class ComponentScanCustomFilterAppIntegrationTest {
@Test
public void testBean() {
public void whenCustomFilterIsUsed_thenComponentScanShouldRegisterBeanMatchingCustomFilter() {
ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ComponentScanCustomFilterApp.class);
List<String> beans = Arrays.stream(applicationContext.getBeanDefinitionNames())
.filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanCustomFilterApp"))

View File

@ -19,7 +19,7 @@ import static org.hamcrest.CoreMatchers.*;
public class ComponentScanRegexFilterAppIntegrationTest {
@Test
public void testBean() {
public void whenRegexFilterIsUsed_thenComponentScanShouldRegisterBeanMatchingRegex() {
ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ComponentScanRegexFilterApp.class);
List<String> beans = Arrays.stream(applicationContext.getBeanDefinitionNames())
.filter(bean -> !bean.contains("org.springframework") && !bean.contains("componentScanRegexFilterApp"))