@Test public void dependsOnMediaTypesClassForCreatingWeightedMediaTypes() { final String value = "text/turtle"; new MockUp<MediaTypes>() { @Mock public MediaType fromString(Invocation context, String aValue) { assertThat(aValue,equalTo(value)); return context.proceed(aValue); } }; final Weighted<MediaType> result=ContentNegotiationUtils.accept(value); assertThat(result.entity().type(),equalTo("text")); assertThat(result.entity().subType(),equalTo("turtle")); assertThat(result.hasWeight(),equalTo(false)); assertThat(result.weight(),equalTo(1.0D)); }
static Weighted<MediaType> accept(final String header) { return Weighted.fromString(header, new MediaTypeParser()); }
ContentNegotiationUtils { static Weighted<MediaType> accept(final String header) { return Weighted.fromString(header, new MediaTypeParser()); } }
ContentNegotiationUtils { static Weighted<MediaType> accept(final String header) { return Weighted.fromString(header, new MediaTypeParser()); } private  ContentNegotiationUtils(); }
ContentNegotiationUtils { static Weighted<MediaType> accept(final String header) { return Weighted.fromString(header, new MediaTypeParser()); } private  ContentNegotiationUtils();  }
ContentNegotiationUtils { static Weighted<MediaType> accept(final String header) { return Weighted.fromString(header, new MediaTypeParser()); } private  ContentNegotiationUtils();   }