JsTopicInterceptor implements Serializable { boolean isJsonPayload(Method method) { if(null == method || !method.isAnnotationPresent(JsTopic.class) ) { return false; } JsTopic jsTopic = method.getAnnotation(JsTopic.class); return jsTopic.jsonPayload(); }  @AroundInvoke Object processJsTopic(InvocationContext ctx);  }
@Test public void isJsonPayloadTest() throws SecurityException, NoSuchMethodException { System.out.println("isJsonPayload"); boolean result = instance.isJsonPayload(null); assertThat(result).isFalse(); Method m = this.getClass().getMethod("methodWithJsTopicAndWithTopicName"); result = instance.isJsonPayload(m); assertThat(result).isFalse(); m = this.getClass().getMethod("methodWithJsTopicAndWithTopicNameAndJsonPayload"); result = instance.isJsonPayload(m); assertThat(result).isTrue(); m = this.getClass().getMethod("methodWithoutJsTopic"); result = instance.isJsonPayload(m); assertThat(result).isFalse(); }