Ejemplo n.º 1
0
  @Test
  public void toString_() {
    MyServiceImpl bean = new MyServiceImpl();

    // with beanName, simple
    assertEquals("myFavoriteService:MyService", myService.toString());
    assertEquals("myFavoriteService:MyService", myService.getBeanDescription());
    assertEquals("myFavoriteService:MyService", myService.getBeanDescription(true));

    // with beanName, long
    assertEquals(
        "myFavoriteService:" + MyService.class.getName(), myService.getBeanDescription(false));

    // no beanName, simple
    assertEquals("MyService", bean.toString());
    assertEquals("MyService", bean.getBeanDescription());
    assertEquals("MyService", bean.getBeanDescription(true));

    // no beanName, long
    assertEquals(MyService.class.getName(), bean.getBeanDescription(false));

    // inner bean
    bean.setBeanName("(inner bean)111");
    assertEquals("MyService", bean.toString());
    assertEquals("MyService", bean.getBeanDescription());
    assertEquals("MyService", bean.getBeanDescription(true));
  }
Ejemplo n.º 2
0
 @Test
 public void getBeanName() {
   assertEquals("myFavoriteService", myService.getBeanName());
 }
Ejemplo n.º 3
0
 @Test
 public void assertInitialized() {
   myService.assertInitialized();
   assertTrue(myService.isInitialized());
 }
Ejemplo n.º 4
0
 @Test
 public void getBeanInterface() {
   assertEquals(MyService.class, myService.getBeanInterface());
 }