vertx/src/test/java/eu/internetofus/common/vertx/ServiceRequestsTest.java
/**
   * Check accept a language defined on the requests.
   */
Check accept a language defined on the requests.
Check accept a language defined on the requests .
@Test
  public void shouldAcceptLanguageInRequest() {
    final var headers = new JsonObject();
    headers.put(HttpHeaders.ACCEPT_LANGUAGE, "fr-CH, fr;q=0.9, en;q=0.8, ca;q=0.7, es;q=0.3,*;q=0.5");
    final var request = new ServiceRequest(new JsonObject().put("headers", headers));
    assertThat(ServiceRequests.acceptedLanguageIn(request, "en", "ca", "es")).isEqualTo("ca");
  }
@ Test public void shouldAcceptLanguageInRequest ( ) { final var headers = new JsonObject ( ) ; headers . put ( HttpHeaders . ACCEPT_LANGUAGE , "fr-CH, fr;q=0.9, en;q=0.8, ca;q=0.7, es;q=0.3,*;q=0.5" ) ; final var request = new ServiceRequest ( new JsonObject ( ) . put ( "headers" , headers ) ) ; assertThat ( ServiceRequests . acceptedLanguageIn ( request , "en" , "ca" , "es" ) ) . isEqualTo ( "ca" ) ; }
Check accept a language defined on the requests.
Check accept a language defined on the requests .