@Test(expectedExceptions = DescriptorValidationFailedException.class)
public void testReadTemplateShouldThrowExceptionWhenTheSpecifiedTemplateDoesntExist() 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)).willThrow(new IOException());
    //WHEN
    underTest.readTemplate(RESOURCE_NAME);
    //THEN exception is thrown
}