use of org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice in project spring-framework by spring-projects.
the class TestPathHelper method verifyResponseBodyAdvice.
@SuppressWarnings("unchecked")
private void verifyResponseBodyAdvice(Object bean) {
assertNotNull(bean);
Object value = new DirectFieldAccessor(bean).getPropertyValue("responseBodyAdvice");
assertNotNull(value);
assertTrue(value instanceof List);
List<ResponseBodyAdvice> converters = (List<ResponseBodyAdvice>) value;
assertTrue(converters.get(0) instanceof JsonViewResponseBodyAdvice);
}
use of org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice in project spring-framework by spring-projects.
the class TestPathHelper method verifyRequestResponseBodyAdvice.
@SuppressWarnings("unchecked")
private void verifyRequestResponseBodyAdvice(Object bean) {
assertNotNull(bean);
Object value = new DirectFieldAccessor(bean).getPropertyValue("requestResponseBodyAdvice");
assertNotNull(value);
assertTrue(value instanceof List);
List<ResponseBodyAdvice> converters = (List<ResponseBodyAdvice>) value;
assertTrue(converters.get(0) instanceof JsonViewRequestBodyAdvice);
assertTrue(converters.get(1) instanceof JsonViewResponseBodyAdvice);
}
Aggregations