Package com.sun.jersey.api.core

Examples of com.sun.jersey.api.core.HttpContext


    @Test
    public void itInjectsTheDefaultLocaleIfTheAcceptLanguagesHeaderIsMalformed() throws Exception {
      final HttpRequestContext request = mock(HttpRequestContext.class);
      when(request.getAcceptableLanguages()).thenThrow(new WebApplicationException(400));
     
      final HttpContext context = mock(HttpContext.class);
      when(context.getRequest()).thenReturn(request);
     
      assertThat(provider.getValue(context), is(Locale.getDefault()));
    }
View Full Code Here


      final WesabeUser user = mock(WesabeUser.class);
     
      final HttpRequestContext request = mock(HttpRequestContext.class);
      when(request.getUserPrincipal()).thenReturn(user);
     
      final HttpContext context = mock(HttpContext.class);
      when(context.getRequest()).thenReturn(request);
     
      assertThat(provider.getValue(context), is(user));
    }
View Full Code Here

TOP

Related Classes of com.sun.jersey.api.core.HttpContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.