### Question:
RabbitAdminNameResolver { static String resolve(final RabbitListener rabbitListener) { String bean = rabbitListener.admin(); if (!hasText(bean) && hasText(rabbitListener.containerFactory())) { bean = rabbitListener.containerFactory() + MultiRabbitConstants.RABBIT_ADMIN_SUFFIX; } if (!hasText(bean)) { bean = MultiRabbitConstants.DEFAULT_RABBIT_ADMIN_BEAN_NAME; } return bean; } private  RabbitAdminNameResolver();   }### Answer:
@Test public void shouldResolveFromAdmin() { when(listener.admin()).thenReturn(DUMMY_ADMIN); assertEquals(DUMMY_ADMIN, RabbitAdminNameResolver.resolve(listener)); verify(listener, atLeastOnce()).admin(); verify(listener, never()).containerFactory(); }
@Test public void shouldResolveFromContainerFactoryWhenNoAdminIsAvailable() { when(listener.containerFactory()).thenReturn(DUMMY_CONTAINER_FACTORY); String expected = DUMMY_CONTAINER_FACTORY + MultiRabbitConstants.RABBIT_ADMIN_SUFFIX; assertEquals(expected, RabbitAdminNameResolver.resolve(listener)); verify(listener, atLeastOnce()).admin(); verify(listener, atLeastOnce()).containerFactory(); }
@Test public void shouldResolveFallbackToDefault() { assertEquals(MultiRabbitConstants.DEFAULT_RABBIT_ADMIN_BEAN_NAME, RabbitAdminNameResolver.resolve(listener)); verify(listener, atLeastOnce()).admin(); verify(listener, atLeastOnce()).containerFactory(); }