SystemResource extends AbstractJaxRSResource { @POST @Path( "/locale" ) @Facet ( name = "Unsupported" ) public Response setLocaleOverride( String locale ) { IPentahoSession session = PentahoSessionHolder.getSession(); Locale newLocale = null; if ( session != null ) { if ( !StringUtils.isEmpty( locale ) ) { String localeTmp = locale.replaceAll( "-|/", "_" ); try { newLocale = LocaleUtils.toLocale( localeTmp ); session.setAttribute( "locale_override", localeTmp ); LocaleHelper.setLocaleOverride( newLocale ); } catch ( IllegalArgumentException ex ) { return Response.serverError().entity( ex.getMessage() ).build(); } } else { session.setAttribute( "locale_override", null ); LocaleHelper.setLocaleOverride( null ); } } else { LocaleHelper.setLocaleOverride( null ); } return getLocale(); } SystemResource();  SystemResource( ISystemConfig systemConfig ); @GET @Produces( { MediaType.APPLICATION_XML } ) @Facet ( name = "Unsupported" ) Response getAll(); @GET @Path( "/authentication-provider" ) @Produces( { MediaType.APPLICATION_JSON } ) @Facet ( name = "Unsupported" ) Response getAuthenticationProvider(); @GET @Path( "/timezones" ) @Produces( { APPLICATION_JSON, APPLICATION_XML } ) @Facet ( name = "Unsupported" ) TimeZoneWrapper getTimeZones(); @GET @Path( "/locale" ) @Facet ( name = "Unsupported" ) Response getLocale(); @POST @Path( "/locale" ) @Facet ( name = "Unsupported" ) Response setLocaleOverride( String locale ); @Path( "/executableTypes" ) @GET @Produces( { APPLICATION_XML, APPLICATION_JSON } ) @Facet ( name = "Unsupported" ) Response getExecutableTypes();  }
@Test public void testSetLocaleOverride() { Response resp = null; try { resp = systemResource.setLocaleOverride( "en_US" ); } catch ( Exception e ) { } Assert.notNull(resp); }