@Test
public void testReadTemplateShouldReturnWithResourceWhenStubResourceHolderDoesntContainTemplateYet() throws IOException {

    //GIVEN
    given(stubResourceHolder.getTemplates()).willReturn(templatesMap);
    given(templatesMap.containsKey(RESOURCE_NAME)).willReturn(false);
    given(fileFactory.createFile(Mockito.anyString())).willReturn(file);
    given(fileUtils.getFileAsByteArray(file)).willReturn(RESOURCE_NAME.getBytes());
    //WHEN
    byte[] actual = underTest.readTemplate(RESOURCE_NAME);
    //THEN
    Mockito.verify(stubResourceHolder).addTemplate(RESOURCE_NAME, actual);
    assertEquals(actual, RESOURCE_NAME.getBytes());
}