@Test
public void retrievesAcceptableWriterMediaTypesFromApplicationProviderBinderAndEmbeddedProviderBinder() throws Exception {

    when(embeddedProviders.getAcceptableWriterMediaTypes(String.class, null, null)).thenReturn(newArrayList(new MediaType("text", "xml"), new MediaType("application", "xml")));
    ObjectFactory<ProviderDescriptor> applicationWriterFactory = mockStringWriterFactory(newArrayList(new MediaType("text", "*"), new MediaType("text", "plain")));
    applicationProviders.addMessageBodyWriter(applicationWriterFactory);
    assertEquals(newArrayList(new MediaType("text", "plain"), new MediaType("text", "*"), new MediaType("text", "xml"), new MediaType("application", "xml")),
                 applicationProviders.getAcceptableWriterMediaTypes(String.class, null, null));
}