OcelotServices { @JsCacheResult(year = 1) @JsonMarshaller(LocaleMarshaller.class) public Locale getLocale() { logger.debug("Receive getLocale call from client."); return ocelotContext.getLocale(); }  void initCore(Options options, HttpSession httpSession); @JsCacheRemove(cls = OcelotServices.class, methodName = "getLocale", keys = {}, userScope = true) void setLocale(@JsonUnmarshaller(LocaleMarshaller.class) Locale locale); @JsCacheResult(year = 1) @JsonMarshaller(LocaleMarshaller.class) Locale getLocale(); String getUsername(); Collection<String> getOutDatedCache(Map<String, Long> states); @JsTopic @WsDataService Integer subscribe(@JsTopicName(prefix = Constants.Topic.SUBSCRIBERS) String topic, Session session); @JsTopic @WsDataService Integer unsubscribe(@JsTopicName(prefix = Constants.Topic.SUBSCRIBERS) String topic, Session session); Integer getNumberSubscribers(String topic); String getVersion();  }
@Test public void testGetLocale() { System.out.println("getLocale"); Locale l = Locale.FRANCE; Locale l2 = Locale.US; when(ocelotContext.getLocale()).thenReturn(l).thenReturn(l2); assertThat(instance.getLocale()).isEqualTo(l); assertThat(instance.getLocale()).isEqualTo(l2); }