@Test( expected = FileNotFoundException.class )
public void testWriteFileAtNewDir() throws IOException {
final String fileName = "test.txt";
final String intermediateDir = "newdir";
final String filePath = publicDirPath + "/" + intermediateDir + "/" + fileName;
IUnifiedRepository repo = mock( IUnifiedRepository.class );
// simulate path does not exist
doReturn( null ).when( repo ).getFile( publicDirPath + "/" + intermediateDir );
mp.defineInstance( IUnifiedRepository.class, repo );
RepositoryFileWriter writer = new RepositoryFileWriter( filePath, "UTF-8" );