@Test
public void testWhenAnExistingFileIsGivenShouldSetAdmins() throws IOException {

    //GIVEN
    List<String> wilmaAdminHosts = new ArrayList<String>();
    wilmaAdminHosts.add("127.0.0.1");
    wilmaAdminHosts.add("otherhost");
    String filePath = "file.txt";
    given(propertyHolder.get(WILMA_ADMIN_HOSTS_FILE)).willReturn(filePath);
    given(bufferedReaderFactory.createBufferedReaderFromFilePath(filePath)).willReturn(bufferedReader);
    given(bufferedReader.ready()).willReturn(true).willReturn(true).willReturn(false);
    given(bufferedReader.readLine()).willReturn("127.0.0.1").willReturn("otherhost");
    //WHEN
    underTest.parseFile();
    //THEN
    verify(wilmaAdminHostsDTO).setWilmaAdminHosts(wilmaAdminHosts);
}