@Test
public void testGenerateNameWithNoDirectory() throws Exception {

  FileContentLocation fileLocation = mock( FileContentLocation.class );
  Repository repository = mock( Repository.class );
  MimeRegistry mimeRegistry = mock( MimeRegistry.class );
  doReturn( mimeRegistry ).when( repository ).getMimeRegistry();
  doReturn( repository ).when( fileLocation ).getRepository();
  File file = mock( File.class );
  doReturn( file ).when( fileLocation ).getContentId();
  doReturn( false ).when( file ).isDirectory();
  try {
    generator.initialize( fileLocation, true );
  } catch ( NullPointerException ex ) {
    assertTrue( true );
  }
}