Merge pull request #7920 from kumar-devender/master
rename test cases to follow BDD style
This commit is contained in:
commit
25023df560
|
@ -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"))
|
||||
|
|
|
@ -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"));
|
||||
|
|
|
@ -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"))
|
||||
|
|
|
@ -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"))
|
||||
|
|
|
@ -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"))
|
||||
|
|
Loading…
Reference in New Issue