OcelotServices { @JsCacheRemove(cls = OcelotServices.class, methodName = "getLocale", keys = {}, userScope = true) public void setLocale(@JsonUnmarshaller(LocaleMarshaller.class) Locale locale) { logger.debug("Receive setLocale call from client. {}", locale); ocelotContext.setLocale(locale); }  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 testSetLocale() { System.out.println("setLocale"); Locale l = Locale.FRANCE; Locale l2 = Locale.US; instance.setLocale(l); instance.setLocale(l2); ArgumentCaptor<Locale> localeCaptor = ArgumentCaptor.forClass(Locale.class); verify(ocelotContext, times(2)).setLocale(localeCaptor.capture()); List<Locale> allValues = localeCaptor.getAllValues(); assertThat(allValues.get(0)).isEqualTo(l); assertThat(allValues.get(1)).isEqualTo(l2); }