View Javadoc

1   package it.com.atlassian.rest.headers;
2   
3   import static org.junit.Assert.*;
4   
5   import org.junit.Test;
6   
7   import com.atlassian.rest.jersey.client.WebResourceFactory;
8   import com.sun.jersey.api.client.ClientResponse;
9   
10  public class LangTest {
11      @Test
12      public void testUMM49codes() {
13          // UM M.49 language code could contains numbers,
14          // for example es-419, see CONF-29922
15          ClientResponse response = WebResourceFactory.anonymous(WebResourceFactory.REST_VERSION)
16                  .path("helloworld").path("locale")
17                  .acceptLanguage("es-419")
18                  .get(ClientResponse.class);
19  
20          // Jersey 1.19 behavior is to return 400, because it fails to parse
21          // incoming request headers. Some parts will result in 500, for example like
22          // ExceptionMapper in the original issue, however bug root cause is the same
23          assertEquals(200, response.getStatus());
24      }
25  }