@Test public void dependsOnLanguagesClassForCreatingWeightedMediaTypes() { final String value = "en-US"; new MockUp<Languages>() { @Mock public Language fromString(Invocation context, String aValue) { assertThat(aValue,equalTo(value)); return context.proceed(aValue); } }; final Weighted<Language> result=ContentNegotiationUtils.acceptLanguage(value); assertThat(result.entity().primaryTag(),equalTo("en")); assertThat(result.entity().subTag(),equalTo("US")); assertThat(result.hasWeight(),equalTo(false)); assertThat(result.weight(),equalTo(1.0D)); }
static Weighted<Language> acceptLanguage(final String header) { return Weighted.fromString(header,new LanguageParser()); }
ContentNegotiationUtils { static Weighted<Language> acceptLanguage(final String header) { return Weighted.fromString(header,new LanguageParser()); } }
ContentNegotiationUtils { static Weighted<Language> acceptLanguage(final String header) { return Weighted.fromString(header,new LanguageParser()); } private  ContentNegotiationUtils(); }
ContentNegotiationUtils { static Weighted<Language> acceptLanguage(final String header) { return Weighted.fromString(header,new LanguageParser()); } private  ContentNegotiationUtils();  }
ContentNegotiationUtils { static Weighted<Language> acceptLanguage(final String header) { return Weighted.fromString(header,new LanguageParser()); } private  ContentNegotiationUtils();   }