JsTopicInterceptor implements Serializable { String getStaticTopic(Method method) { if(null == method || !method.isAnnotationPresent(JsTopic.class) ) { return null; } JsTopic jsTopic = method.getAnnotation(JsTopic.class); return jsTopic.value(); }  @AroundInvoke Object processJsTopic(InvocationContext ctx);  }
@Test public void testGetStaticTopic() throws Exception { System.out.println("getStaticTopic"); Method methodAnnotated = this.getClass().getMethod("methodWithJsTopicAndWithTopicName"); Method methodNotAnnotated = this.getClass().getMethod("methodWithoutJsTopic"); String result = instance.getStaticTopic(null); assertThat(result).isEqualTo(null); result = instance.getStaticTopic(methodNotAnnotated); assertThat(result).isEqualTo(null); result = instance.getStaticTopic(methodAnnotated); assertThat(result).isEqualTo("TOPICNAME"); }