JsCacheAnnotationServices { public void processJsCacheRemove(JsCacheRemove jcr, List<String> paramNames, List<String> jsonArgs) { logger.debug("Process JsCacheRemove annotation : {}", jcr); MessageToClient messageToClient = new MessageToClient(); messageToClient.setId(Constants.Cache.CLEANCACHE_TOPIC); String argpart = cacheArgumentServices.computeArgPart(jcr.keys(), jsonArgs, paramNames); String cachekey = computeCacheKey(jcr.cls(), jcr.methodName(), argpart); if (logger.isDebugEnabled()) { logger.debug("JsonArgs from Call : {}", Arrays.toString(jsonArgs.toArray(new String[jsonArgs.size()]))); logger.debug("ParamName from considerated method : {}", Arrays.toString(paramNames.toArray(new String[paramNames.size()]))); logger.debug("Computed key : {}", cachekey); } messageToClient.setResponse(cachekey); if (jcr.userScope()) { wsUserEvent.fire(messageToClient); } else { wsEvent.fire(messageToClient); cacheEvent.fire(cachekey); } }  void processJsCacheRemoveAll(); long getJsCacheResultDeadline(JsCacheResult jcr); void processJsCacheRemove(JsCacheRemove jcr, List<String> paramNames, List<String> jsonArgs);  }
@Test public void testProcessJsCacheRemove() { System.out.println("processJsCacheRemove"); JsCacheRemove jcr = new LiteralJsCacheRemove(this.getClass(), "testProcessJsCacheRemove", new String[] {}, false); testProcessJsCacheRemove(jcr); ArgumentCaptor<MessageToClient> captureMTC = ArgumentCaptor.forClass(MessageToClient.class); verify(wsEvent).fire(captureMTC.capture()); assertThat(captureMTC.getValue().getId()).isEqualTo(Constants.Cache.CLEANCACHE_TOPIC); assertThat(captureMTC.getValue().getResponse()).isEqualTo("MD5"); ArgumentCaptor<String> captureCacheKey = ArgumentCaptor.forClass(String.class); verify(cacheEvent).fire(captureCacheKey.capture()); assertThat(captureCacheKey.getValue()).isEqualTo("MD5"); }