@Test
@SuppressWarnings("unchecked")
public void shouldInitialiseCacheWithSingleMappingBean() throws Exception {

    final MediaType mediaType = new MediaType("application/vnd.example.add-recipe+json");
    final String schemaId = "http://justice.gov.uk/example/command/api/example.add-recipe.json";
    final Map<MediaType, String> mediaTypeToSchemaIdMap = of(mediaType, schemaId);
    final Bean<MediaTypeToSchemaIdMapper> bean_1 = mock(Bean.class);
    final MediaTypeToSchemaIdMapper mediaTypeToSchemaIdMapper = mock(MediaTypeToSchemaIdMapper.class);
    when(schemaIdMappingObserver.getMediaTypeToSchemaIdMappers()).thenReturn(singletonList(bean_1));
    when(beanInstantiater.instantiate(bean_1)).thenReturn(mediaTypeToSchemaIdMapper);
    when(mediaTypeToSchemaIdMapper.getMediaTypeToSchemaIdMap()).thenReturn(mediaTypeToSchemaIdMap);
    final Map<MediaType, String> mappingCache = schemaIdMappingCacheInitialiser.initialiseCache();
    assertThat(mappingCache.size(), is(1));
    assertThat(mappingCache.get(mediaType), is(schemaId));
}