Skip to content

Commit

Permalink
Add unit test in BeanRegistrationUtilTest
Browse files Browse the repository at this point in the history
  • Loading branch information
refeccd authored and nobodyiam committed Sep 20, 2022
1 parent 2fefcc7 commit 9e8e8fa
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,13 @@ public void registerBeanDefinitionIfNotExistsTest() {
getClass(), null));
assertFalse(BeanRegistrationUtil.registerBeanDefinitionIfNotExists(someRegistry, someBeanName,
getClass()));

}

@Test
public void registerBeanDefinitionIfNotExistsBeanNotPresentTest() {
someRegistry.registerBeanDefinition("someAnotherBean", Mockito.mock(BeanDefinition.class));
assertTrue(BeanRegistrationUtil.registerBeanDefinitionIfNotExists(someRegistry, someBeanName,
getClass(), null));

}

@Test
Expand All @@ -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));
}

}
}

0 comments on commit 9e8e8fa

Please sign in to comment.