diff --git a/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/util/BeanRegistrationUtilTest.java b/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/util/BeanRegistrationUtilTest.java index 6a63ea909fc..ff7aa2241af 100644 --- a/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/util/BeanRegistrationUtilTest.java +++ b/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/util/BeanRegistrationUtilTest.java @@ -50,7 +50,6 @@ public void registerBeanDefinitionIfNotExistsTest() { getClass(), null)); assertFalse(BeanRegistrationUtil.registerBeanDefinitionIfNotExists(someRegistry, someBeanName, getClass())); - } @Test @@ -58,7 +57,6 @@ public void registerBeanDefinitionIfNotExistsBeanNotPresentTest() { someRegistry.registerBeanDefinition("someAnotherBean", Mockito.mock(BeanDefinition.class)); assertTrue(BeanRegistrationUtil.registerBeanDefinitionIfNotExists(someRegistry, someBeanName, getClass(), null)); - } @Test @@ -68,7 +66,12 @@ public void registerBeanDefinitionIfNotExistsWithExtPropTest() { extraPropertyValues.put(someBeanName, "someProperty"); assertTrue(BeanRegistrationUtil.registerBeanDefinitionIfNotExists(someRegistry, someBeanName, getClass(), extraPropertyValues)); + } + @Test + public void registerBeanDefinitionIfNotExistsWithoutBeanNameTest() { + someRegistry.registerBeanDefinition(BeanDefinition.class.getName(), Mockito.mock(BeanDefinition.class)); + assertFalse(BeanRegistrationUtil.registerBeanDefinitionIfNotExists(someRegistry, BeanDefinition.class)); } -} +} \ No newline at end of file