@Test
public void testOnApplicationEventShouldInitializeAllowedHosts() {

    //GIVEN
    List<String> adminHosts = new ArrayList<>();
    adminHosts.add("a");
    adminHosts.add("b");
    given(wilmaAdminHostsDTO.getWilmaAdminHosts()).willReturn(adminHosts);
    given(ipAddressResolver.resolveToHostName("a")).willReturn("a");
    given(ipAddressResolver.resolveToHostName("b")).willReturn("b");
    //WHEN
    underTest.onApplicationEvent(null);
    //THEN
    assertEquals(adminHosts, Whitebox.getInternalState(underTest, "allowedHosts"));
}