@Test public void hasValidAnnotation_false() { Annotation annotation = createMockAnnotation(Annotation.class); Annotation[] annotations = new Annotation[] { annotation }; replayAll(); assertFalse(ValidatingJacksonJsonProvider.hasValidAnnotation(annotations)); }
@VisibleForTesting static boolean hasValidAnnotation(Annotation[] annotations) { for (Annotation annotation : annotations) { if (Valid.class.equals(annotation.annotationType())) { return true; } } return false; }
ValidatingJacksonJsonProvider implements MessageBodyReader<Object>, MessageBodyWriter<Object> { @VisibleForTesting static boolean hasValidAnnotation(Annotation[] annotations) { for (Annotation annotation : annotations) { if (Valid.class.equals(annotation.annotationType())) { return true; } } return false; } }
ValidatingJacksonJsonProvider implements MessageBodyReader<Object>, MessageBodyWriter<Object> { @VisibleForTesting static boolean hasValidAnnotation(Annotation[] annotations) { for (Annotation annotation : annotations) { if (Valid.class.equals(annotation.annotationType())) { return true; } } return false; } @Inject  ValidatingJacksonJsonProvider(JacksonJsonProvider delegate, Validator validator); }
ValidatingJacksonJsonProvider implements MessageBodyReader<Object>, MessageBodyWriter<Object> { @VisibleForTesting static boolean hasValidAnnotation(Annotation[] annotations) { for (Annotation annotation : annotations) { if (Valid.class.equals(annotation.annotationType())) { return true; } } return false; } @Inject  ValidatingJacksonJsonProvider(JacksonJsonProvider delegate, Validator validator); @Override Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations,
      MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream); @Override void writeTo(Object t, Class<?> type, Type genericType, Annotation[] annotations,
      MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream); @Override boolean isWriteable(Class<?> type, Type genericType,
      Annotation[] annotations, MediaType mediaType); @Override long getSize(Object t, Class<?> type, Type genericType,
      Annotation[] annotations, MediaType mediaType); @Override boolean isReadable(Class<?> type, Type genericType,
      Annotation[] annotations, MediaType mediaType); }
ValidatingJacksonJsonProvider implements MessageBodyReader<Object>, MessageBodyWriter<Object> { @VisibleForTesting static boolean hasValidAnnotation(Annotation[] annotations) { for (Annotation annotation : annotations) { if (Valid.class.equals(annotation.annotationType())) { return true; } } return false; } @Inject  ValidatingJacksonJsonProvider(JacksonJsonProvider delegate, Validator validator); @Override Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations,
      MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream); @Override void writeTo(Object t, Class<?> type, Type genericType, Annotation[] annotations,
      MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream); @Override boolean isWriteable(Class<?> type, Type genericType,
      Annotation[] annotations, MediaType mediaType); @Override long getSize(Object t, Class<?> type, Type genericType,
      Annotation[] annotations, MediaType mediaType); @Override boolean isReadable(Class<?> type, Type genericType,
      Annotation[] annotations, MediaType mediaType);  }