OcelotServices { @JsTopic @WsDataService public Integer unsubscribe(@JsTopicName(prefix = Constants.Topic.SUBSCRIBERS) String topic, Session session) { return topicManager.unregisterTopicSession(topic, session); }  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 testUnsubscribe_String() { System.out.println("unsubscribe"); instance.unsubscribe("TOPIC", null); verify(topicManager).unregisterTopicSession(eq("TOPIC"), any(Session.class)); }
@Test public void testUnsubscribe_Session_String() { System.out.println("unsubscribe"); when(topicManager.unregisterTopicSession(anyString(), any(Session.class))).thenReturn(0); Integer result = instance.unsubscribe("TOPIC", null); assertThat(result).isEqualTo(0); }