@Test
public void testShouldThrowExceptionWhenParsingClassListMap()
    throws IOException
{

    syncParams.setImportParams( new MetadataImportParams() );
    syncParams.setVersion( metadataVersion );
    importReport.setStatus( Status.OK );
    when( renderService.fromMetadata( any( InputStream.class ), eq( RenderFormat.JSON ) ) )
        .thenThrow( new IOException() );
    expectedException.expect( MetadataSyncServiceException.class );
    expectedException
        .expectMessage( "Exception occurred while trying to do JSON conversion while parsing class list map" );
    metadataSyncImportHandler.importMetadata( syncParams, expectedMetadataSnapshot );
    verify( renderService ).fromMetadata( any( InputStream.class ), RenderFormat.JSON );
    verify( metadataImportService, never() ).importMetadata( syncParams.getImportParams() );
    verify( metadataVersionDelegate, never() ).addNewMetadataVersion( metadataVersion );
    verify( metadataVersionDelegate, never() ).addNewMetadataVersion( metadataVersion );
}