Skip to content

Commit

Permalink
User AssertJ's hasSize() for arrays
Browse files Browse the repository at this point in the history
Achieved via global search-and-replace.
  • Loading branch information
sbrannen committed Nov 22, 2022
1 parent 36f7597 commit d5b0b2b
Show file tree
Hide file tree
Showing 72 changed files with 277 additions and 277 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void perThisAspect() throws Exception {

Advised advised = (Advised) itb;
// Will be ExposeInvocationInterceptor, synthetic instantiation advisor, 2 method advisors
assertThat(advised.getAdvisors().length).isEqualTo(4);
assertThat(advised.getAdvisors()).hasSize(4);
ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor sia =
(ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor) advised.getAdvisors()[1];
assertThat(sia.getPointcut().getMethodMatcher().matches(TestBean.class.getMethod("getSpouse"), null)).isTrue();
Expand Down Expand Up @@ -231,7 +231,7 @@ void perTypeWithinAspect() throws Exception {

Advised advised = (Advised) itb;
// Will be ExposeInvocationInterceptor, synthetic instantiation advisor, 2 method advisors
assertThat(advised.getAdvisors().length).isEqualTo(4);
assertThat(advised.getAdvisors()).hasSize(4);
ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor sia =
(ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor) advised.getAdvisors()[1];
assertThat(sia.getPointcut().getMethodMatcher().matches(TestBean.class.getMethod("getSpouse"), null)).isTrue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void testSerializationWithNoPatternSupplied() throws Exception {
protected void noPatternSuppliedTests(AbstractRegexpMethodPointcut rpc) throws Exception {
assertThat(rpc.matches(Object.class.getMethod("hashCode"), String.class)).isFalse();
assertThat(rpc.matches(Object.class.getMethod("wait"), Object.class)).isFalse();
assertThat(rpc.getPatterns().length).isEqualTo(0);
assertThat(rpc.getPatterns()).hasSize(0);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void getPropertyValueNullValueInNestedPathNoDefaultConstructor() {
@Test
public void getPropertyValueAutoGrowArray() {
assertNotNull(wrapper.getPropertyValue("array[0]"));
assertThat(bean.getArray().length).isEqualTo(1);
assertThat(bean.getArray()).hasSize(1);
assertThat(bean.getArray()[0]).isInstanceOf(Bean.class);
}

Expand All @@ -76,7 +76,7 @@ public void setPropertyValueAutoGrowArray() {
@Test
public void getPropertyValueAutoGrowArrayBySeveralElements() {
assertNotNull(wrapper.getPropertyValue("array[4]"));
assertThat(bean.getArray().length).isEqualTo(5);
assertThat(bean.getArray()).hasSize(5);
assertThat(bean.getArray()[0]).isInstanceOf(Bean.class);
assertThat(bean.getArray()[1]).isInstanceOf(Bean.class);
assertThat(bean.getArray()[2]).isInstanceOf(Bean.class);
Expand All @@ -91,7 +91,7 @@ public void getPropertyValueAutoGrowArrayBySeveralElements() {
@Test
public void getPropertyValueAutoGrow2dArray() {
assertNotNull(wrapper.getPropertyValue("multiArray[0][0]"));
assertThat(bean.getMultiArray()[0].length).isEqualTo(1);
assertThat(bean.getMultiArray()[0]).hasSize(1);
assertThat(bean.getMultiArray()[0][0]).isInstanceOf(Bean.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void testCustomEnumArrayWithSingleValue() {
GenericBean<?> gb = new GenericBean<>();
BeanWrapper bw = new BeanWrapperImpl(gb);
bw.setPropertyValue("customEnumArray", "VALUE_1");
assertThat(gb.getCustomEnumArray().length).isEqualTo(1);
assertThat(gb.getCustomEnumArray()).hasSize(1);
assertThat(gb.getCustomEnumArray()[0]).isEqualTo(CustomEnum.VALUE_1);
}

Expand All @@ -71,7 +71,7 @@ public void testCustomEnumArrayWithMultipleValues() {
GenericBean<?> gb = new GenericBean<>();
BeanWrapper bw = new BeanWrapperImpl(gb);
bw.setPropertyValue("customEnumArray", new String[] {"VALUE_1", "VALUE_2"});
assertThat(gb.getCustomEnumArray().length).isEqualTo(2);
assertThat(gb.getCustomEnumArray()).hasSize(2);
assertThat(gb.getCustomEnumArray()[0]).isEqualTo(CustomEnum.VALUE_1);
assertThat(gb.getCustomEnumArray()[1]).isEqualTo(CustomEnum.VALUE_2);
}
Expand All @@ -81,7 +81,7 @@ public void testCustomEnumArrayWithMultipleValuesAsCsv() {
GenericBean<?> gb = new GenericBean<>();
BeanWrapper bw = new BeanWrapperImpl(gb);
bw.setPropertyValue("customEnumArray", "VALUE_1,VALUE_2");
assertThat(gb.getCustomEnumArray().length).isEqualTo(2);
assertThat(gb.getCustomEnumArray()).hasSize(2);
assertThat(gb.getCustomEnumArray()[0]).isEqualTo(CustomEnum.VALUE_1);
assertThat(gb.getCustomEnumArray()[1]).isEqualTo(CustomEnum.VALUE_2);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ public Class<?> getProp() {
}
{ // always passes
BeanInfo info = Introspector.getBeanInfo(Bean.class);
assertThat(info.getPropertyDescriptors().length).isEqualTo(2);
assertThat(info.getPropertyDescriptors()).hasSize(2);
}
{ // failed prior to fix for SPR-9453
BeanInfo info = new ExtendedBeanInfo(Introspector.getBeanInfo(Bean.class));
assertThat(info.getPropertyDescriptors().length).isEqualTo(2);
assertThat(info.getPropertyDescriptors()).hasSize(2);
}
}

Expand Down Expand Up @@ -585,7 +585,7 @@ class C extends B {
assertThat(hasReadMethodForProperty(ebi, "foo")).isTrue();
assertThat(hasWriteMethodForProperty(ebi, "foo")).isTrue();

assertThat(ebi.getPropertyDescriptors().length).isEqualTo(bi.getPropertyDescriptors().length);
assertThat(ebi.getPropertyDescriptors()).hasSize(bi.getPropertyDescriptors().length);
}

@Test
Expand Down Expand Up @@ -711,7 +711,7 @@ void propertyCountsMatch() throws Exception {
BeanInfo bi = Introspector.getBeanInfo(TestBean.class);
BeanInfo ebi = new ExtendedBeanInfo(bi);

assertThat(ebi.getPropertyDescriptors().length).isEqualTo(bi.getPropertyDescriptors().length);
assertThat(ebi.getPropertyDescriptors()).hasSize(bi.getPropertyDescriptors().length);
}

@Test
Expand All @@ -731,7 +731,7 @@ class ExtendedTestBean extends TestBean {
}
}
assertThat(found).isTrue();
assertThat(ebi.getPropertyDescriptors().length).isEqualTo(bi.getPropertyDescriptors().length+1);
assertThat(ebi.getPropertyDescriptors()).hasSize(bi.getPropertyDescriptors().length+1);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public void testExtendedResourceInjection() {
assertThat(bean.getBeanFactory()).isSameAs(bf);

String[] depBeans = bf.getDependenciesForBean("annotatedBean");
assertThat(depBeans.length).isEqualTo(2);
assertThat(depBeans).hasSize(2);
assertThat(depBeans[0]).isEqualTo("testBean");
assertThat(depBeans[1]).isEqualTo("nestedTestBean");
}
Expand Down Expand Up @@ -266,10 +266,10 @@ public void testOptionalResourceInjection() {
assertThat(bean.getTestBean3()).isSameAs(tb);
assertThat(bean.getTestBean4()).isSameAs(tb);
assertThat(bean.getIndexedTestBean()).isSameAs(itb);
assertThat(bean.getNestedTestBeans().length).isEqualTo(2);
assertThat(bean.getNestedTestBeans()).hasSize(2);
assertThat(bean.getNestedTestBeans()[0]).isSameAs(ntb1);
assertThat(bean.getNestedTestBeans()[1]).isSameAs(ntb2);
assertThat(bean.nestedTestBeansField.length).isEqualTo(2);
assertThat(bean.nestedTestBeansField).hasSize(2);
assertThat(bean.nestedTestBeansField[0]).isSameAs(ntb1);
assertThat(bean.nestedTestBeansField[1]).isSameAs(ntb2);
}
Expand All @@ -294,10 +294,10 @@ public void testOptionalResourceInjectionWithSingletonRemoval() {
assertThat(bean.getTestBean3()).isSameAs(tb);
assertThat(bean.getTestBean4()).isSameAs(tb);
assertThat(bean.getIndexedTestBean()).isSameAs(itb);
assertThat(bean.getNestedTestBeans().length).isEqualTo(2);
assertThat(bean.getNestedTestBeans()).hasSize(2);
assertThat(bean.getNestedTestBeans()[0]).isSameAs(ntb1);
assertThat(bean.getNestedTestBeans()[1]).isSameAs(ntb2);
assertThat(bean.nestedTestBeansField.length).isEqualTo(2);
assertThat(bean.nestedTestBeansField).hasSize(2);
assertThat(bean.nestedTestBeansField[0]).isSameAs(ntb1);
assertThat(bean.nestedTestBeansField[1]).isSameAs(ntb2);

Expand All @@ -309,10 +309,10 @@ public void testOptionalResourceInjectionWithSingletonRemoval() {
assertThat(bean.getTestBean3()).isNull();
assertThat(bean.getTestBean4()).isNull();
assertThat(bean.getIndexedTestBean()).isSameAs(itb);
assertThat(bean.getNestedTestBeans().length).isEqualTo(2);
assertThat(bean.getNestedTestBeans()).hasSize(2);
assertThat(bean.getNestedTestBeans()[0]).isSameAs(ntb1);
assertThat(bean.getNestedTestBeans()[1]).isSameAs(ntb2);
assertThat(bean.nestedTestBeansField.length).isEqualTo(2);
assertThat(bean.nestedTestBeansField).hasSize(2);
assertThat(bean.nestedTestBeansField[0]).isSameAs(ntb1);
assertThat(bean.nestedTestBeansField[1]).isSameAs(ntb2);

Expand All @@ -324,10 +324,10 @@ public void testOptionalResourceInjectionWithSingletonRemoval() {
assertThat(bean.getTestBean3()).isSameAs(tb);
assertThat(bean.getTestBean4()).isSameAs(tb);
assertThat(bean.getIndexedTestBean()).isSameAs(itb);
assertThat(bean.getNestedTestBeans().length).isEqualTo(2);
assertThat(bean.getNestedTestBeans()).hasSize(2);
assertThat(bean.getNestedTestBeans()[0]).isSameAs(ntb1);
assertThat(bean.getNestedTestBeans()[1]).isSameAs(ntb2);
assertThat(bean.nestedTestBeansField.length).isEqualTo(2);
assertThat(bean.nestedTestBeansField).hasSize(2);
assertThat(bean.nestedTestBeansField[0]).isSameAs(ntb1);
assertThat(bean.nestedTestBeansField[1]).isSameAs(ntb2);
}
Expand All @@ -351,10 +351,10 @@ public void testOptionalResourceInjectionWithBeanDefinitionRemoval() {
assertThat(bean.getTestBean3()).isSameAs(bf.getBean("testBean"));
assertThat(bean.getTestBean4()).isSameAs(bf.getBean("testBean"));
assertThat(bean.getIndexedTestBean()).isSameAs(itb);
assertThat(bean.getNestedTestBeans().length).isEqualTo(2);
assertThat(bean.getNestedTestBeans()).hasSize(2);
assertThat(bean.getNestedTestBeans()[0]).isSameAs(ntb1);
assertThat(bean.getNestedTestBeans()[1]).isSameAs(ntb2);
assertThat(bean.nestedTestBeansField.length).isEqualTo(2);
assertThat(bean.nestedTestBeansField).hasSize(2);
assertThat(bean.nestedTestBeansField[0]).isSameAs(ntb1);
assertThat(bean.nestedTestBeansField[1]).isSameAs(ntb2);

Expand All @@ -366,10 +366,10 @@ public void testOptionalResourceInjectionWithBeanDefinitionRemoval() {
assertThat(bean.getTestBean3()).isNull();
assertThat(bean.getTestBean4()).isNull();
assertThat(bean.getIndexedTestBean()).isSameAs(itb);
assertThat(bean.getNestedTestBeans().length).isEqualTo(2);
assertThat(bean.getNestedTestBeans()).hasSize(2);
assertThat(bean.getNestedTestBeans()[0]).isSameAs(ntb1);
assertThat(bean.getNestedTestBeans()[1]).isSameAs(ntb2);
assertThat(bean.nestedTestBeansField.length).isEqualTo(2);
assertThat(bean.nestedTestBeansField).hasSize(2);
assertThat(bean.nestedTestBeansField[0]).isSameAs(ntb1);
assertThat(bean.nestedTestBeansField[1]).isSameAs(ntb2);

Expand All @@ -381,10 +381,10 @@ public void testOptionalResourceInjectionWithBeanDefinitionRemoval() {
assertThat(bean.getTestBean3()).isSameAs(bf.getBean("testBean"));
assertThat(bean.getTestBean4()).isSameAs(bf.getBean("testBean"));
assertThat(bean.getIndexedTestBean()).isSameAs(itb);
assertThat(bean.getNestedTestBeans().length).isEqualTo(2);
assertThat(bean.getNestedTestBeans()).hasSize(2);
assertThat(bean.getNestedTestBeans()[0]).isSameAs(ntb1);
assertThat(bean.getNestedTestBeans()[1]).isSameAs(ntb2);
assertThat(bean.nestedTestBeansField.length).isEqualTo(2);
assertThat(bean.nestedTestBeansField).hasSize(2);
assertThat(bean.nestedTestBeansField[0]).isSameAs(ntb1);
assertThat(bean.nestedTestBeansField[1]).isSameAs(ntb2);
}
Expand Down Expand Up @@ -496,10 +496,10 @@ public void testOrderedResourceInjection() {
assertThat(bean.getTestBean3()).isSameAs(tb);
assertThat(bean.getTestBean4()).isSameAs(tb);
assertThat(bean.getIndexedTestBean()).isSameAs(itb);
assertThat(bean.getNestedTestBeans().length).isEqualTo(2);
assertThat(bean.getNestedTestBeans()).hasSize(2);
assertThat(bean.getNestedTestBeans()[0]).isSameAs(ntb2);
assertThat(bean.getNestedTestBeans()[1]).isSameAs(ntb1);
assertThat(bean.nestedTestBeansField.length).isEqualTo(2);
assertThat(bean.nestedTestBeansField).hasSize(2);
assertThat(bean.nestedTestBeansField[0]).isSameAs(ntb2);
assertThat(bean.nestedTestBeansField[1]).isSameAs(ntb1);
}
Expand All @@ -522,10 +522,10 @@ public void testAnnotationOrderedResourceInjection() {
assertThat(bean.getTestBean3()).isSameAs(tb);
assertThat(bean.getTestBean4()).isSameAs(tb);
assertThat(bean.getIndexedTestBean()).isSameAs(itb);
assertThat(bean.getNestedTestBeans().length).isEqualTo(2);
assertThat(bean.getNestedTestBeans()).hasSize(2);
assertThat(bean.getNestedTestBeans()[0]).isSameAs(ntb2);
assertThat(bean.getNestedTestBeans()[1]).isSameAs(ntb1);
assertThat(bean.nestedTestBeansField.length).isEqualTo(2);
assertThat(bean.nestedTestBeansField).hasSize(2);
assertThat(bean.nestedTestBeansField[0]).isSameAs(ntb2);
assertThat(bean.nestedTestBeansField[1]).isSameAs(ntb1);
}
Expand Down Expand Up @@ -772,7 +772,7 @@ public void testConstructorResourceInjectionWithMultipleCandidates() {
ConstructorsResourceInjectionBean bean = (ConstructorsResourceInjectionBean) bf.getBean("annotatedBean");
assertThat(bean.getTestBean3()).isNull();
assertThat(bean.getTestBean4()).isSameAs(tb);
assertThat(bean.getNestedTestBeans().length).isEqualTo(2);
assertThat(bean.getNestedTestBeans()).hasSize(2);
assertThat(bean.getNestedTestBeans()[0]).isSameAs(ntb1);
assertThat(bean.getNestedTestBeans()[1]).isSameAs(ntb2);
}
Expand Down Expand Up @@ -838,7 +838,7 @@ public void testConstructorResourceInjectionWithMultipleOrderedCandidates() {
ConstructorsResourceInjectionBean bean = (ConstructorsResourceInjectionBean) bf.getBean("annotatedBean");
assertThat(bean.getTestBean3()).isNull();
assertThat(bean.getTestBean4()).isSameAs(tb);
assertThat(bean.getNestedTestBeans().length).isEqualTo(2);
assertThat(bean.getNestedTestBeans()).hasSize(2);
assertThat(bean.getNestedTestBeans()[0]).isSameAs(ntb2);
assertThat(bean.getNestedTestBeans()[1]).isSameAs(ntb1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ private void doTestPropertyPlaceholderConfigurer(boolean parentChildSeparation)
assertThat(tb1.getSpouse()).isEqualTo(tb2);
assertThat(tb1.getSomeMap()).hasSize(1);
assertThat(tb1.getSomeMap().get("myKey")).isEqualTo("myValue");
assertThat(tb2.getStringArray().length).isEqualTo(2);
assertThat(tb2.getStringArray()).hasSize(2);
assertThat(tb2.getStringArray()[0]).isEqualTo(System.getProperty("os.name"));
assertThat(tb2.getStringArray()[1]).isEqualTo("98");
assertThat(tb2.getFriends()).hasSize(2);
Expand Down Expand Up @@ -577,7 +577,7 @@ public void testPropertyPlaceholderConfigurerWithSelfReferencingPlaceholderInAli

TestBean tb = (TestBean) factory.getBean("tb");
assertThat(tb).isNotNull();
assertThat(factory.getAliases("tb").length).isEqualTo(0);
assertThat(factory.getAliases("tb")).hasSize(0);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public Object get(String name, ObjectFactory<?> objectFactory) {
beanFactory.registerScope("myScope", scope);

String[] scopeNames = beanFactory.getRegisteredScopeNames();
assertThat(scopeNames.length).isEqualTo(1);
assertThat(scopeNames).hasSize(1);
assertThat(scopeNames[0]).isEqualTo("myScope");
assertThat(beanFactory.getRegisteredScope("myScope")).isSameAs(scope);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ public void testSingletons() {
assertThat(beanRegistry.getSingleton("tb2")).isSameAs(tb2);
assertThat(beanRegistry.getSingletonCount()).isEqualTo(2);
String[] names = beanRegistry.getSingletonNames();
assertThat(names.length).isEqualTo(2);
assertThat(names).hasSize(2);
assertThat(names[0]).isEqualTo("tb");
assertThat(names[1]).isEqualTo("tb2");

beanRegistry.destroySingletons();
assertThat(beanRegistry.getSingletonCount()).isEqualTo(0);
assertThat(beanRegistry.getSingletonNames().length).isEqualTo(0);
assertThat(beanRegistry.getSingletonNames()).hasSize(0);
}

@Test
Expand All @@ -66,13 +66,13 @@ public void testDisposableBean() {
assertThat(beanRegistry.getSingleton("tb")).isSameAs(tb);
assertThat(beanRegistry.getSingletonCount()).isEqualTo(1);
String[] names = beanRegistry.getSingletonNames();
assertThat(names.length).isEqualTo(1);
assertThat(names).hasSize(1);
assertThat(names[0]).isEqualTo("tb");
assertThat(tb.wasDestroyed()).isFalse();

beanRegistry.destroySingletons();
assertThat(beanRegistry.getSingletonCount()).isEqualTo(0);
assertThat(beanRegistry.getSingletonNames().length).isEqualTo(0);
assertThat(beanRegistry.getSingletonNames()).hasSize(0);
assertThat(tb.wasDestroyed()).isTrue();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,23 @@ void defaultsEventReceived() throws Exception {
void beanEventReceived() throws Exception {
ComponentDefinition componentDefinition1 = this.eventListener.getComponentDefinition("testBean");
assertThat(componentDefinition1).isInstanceOf(BeanComponentDefinition.class);
assertThat(componentDefinition1.getBeanDefinitions().length).isEqualTo(1);
assertThat(componentDefinition1.getBeanDefinitions()).hasSize(1);
BeanDefinition beanDefinition1 = componentDefinition1.getBeanDefinitions()[0];
assertThat(beanDefinition1.getConstructorArgumentValues().getGenericArgumentValue(String.class).getValue()).isEqualTo(new TypedStringValue("Rob Harrop"));
assertThat(componentDefinition1.getBeanReferences().length).isEqualTo(1);
assertThat(componentDefinition1.getBeanReferences()).hasSize(1);
assertThat(componentDefinition1.getBeanReferences()[0].getBeanName()).isEqualTo("testBean2");
assertThat(componentDefinition1.getInnerBeanDefinitions().length).isEqualTo(1);
assertThat(componentDefinition1.getInnerBeanDefinitions()).hasSize(1);
BeanDefinition innerBd1 = componentDefinition1.getInnerBeanDefinitions()[0];
assertThat(innerBd1.getConstructorArgumentValues().getGenericArgumentValue(String.class).getValue()).isEqualTo(new TypedStringValue("ACME"));
assertThat(componentDefinition1.getSource()).isInstanceOf(Element.class);

ComponentDefinition componentDefinition2 = this.eventListener.getComponentDefinition("testBean2");
assertThat(componentDefinition2).isInstanceOf(BeanComponentDefinition.class);
assertThat(componentDefinition1.getBeanDefinitions().length).isEqualTo(1);
assertThat(componentDefinition1.getBeanDefinitions()).hasSize(1);
BeanDefinition beanDefinition2 = componentDefinition2.getBeanDefinitions()[0];
assertThat(beanDefinition2.getPropertyValues().getPropertyValue("name").getValue()).isEqualTo(new TypedStringValue("Juergen Hoeller"));
assertThat(componentDefinition2.getBeanReferences().length).isEqualTo(0);
assertThat(componentDefinition2.getInnerBeanDefinitions().length).isEqualTo(1);
assertThat(componentDefinition2.getBeanReferences()).hasSize(0);
assertThat(componentDefinition2.getInnerBeanDefinitions()).hasSize(1);
BeanDefinition innerBd2 = componentDefinition2.getInnerBeanDefinitions()[0];
assertThat(innerBd2.getPropertyValues().getPropertyValue("name").getValue()).isEqualTo(new TypedStringValue("Eva Schallmeiner"));
assertThat(componentDefinition2.getSource()).isInstanceOf(Element.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void testNestedCollections() {
void testNestedShortcutCollections() {
TestBean bean = (TestBean) this.beanFactory.getBean("nestedShortcutCollections");

assertThat(bean.getStringArray().length).isEqualTo(1);
assertThat(bean.getStringArray()).hasSize(1);
assertThat(bean.getStringArray()[0]).isEqualTo("fooStr");

List<?> list = bean.getSomeList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void withFreshInputStream() {

private void testBeanDefinitions(BeanDefinitionRegistry registry) {
assertThat(registry.getBeanDefinitionCount()).isEqualTo(24);
assertThat(registry.getBeanDefinitionNames().length).isEqualTo(24);
assertThat(registry.getBeanDefinitionNames()).hasSize(24);
assertThat(Arrays.asList(registry.getBeanDefinitionNames()).contains("rod")).isTrue();
assertThat(Arrays.asList(registry.getBeanDefinitionNames()).contains("aliased")).isTrue();
assertThat(registry.containsBeanDefinition("rod")).isTrue();
Expand All @@ -118,7 +118,7 @@ private void testBeanDefinitions(BeanDefinitionRegistry registry) {
assertThat(registry.getBeanDefinition("aliased").getBeanClassName()).isEqualTo(TestBean.class.getName());
assertThat(registry.isAlias("youralias")).isTrue();
String[] aliases = registry.getAliases("aliased");
assertThat(aliases.length).isEqualTo(2);
assertThat(aliases).hasSize(2);
assertThat(ObjectUtils.containsElement(aliases, "myalias")).isTrue();
assertThat(ObjectUtils.containsElement(aliases, "youralias")).isTrue();
}
Expand Down
Loading

0 comments on commit d5b0b2b

Please sign in to comment.