### Question:
SpringViewResolverProvider extends AbstractResponseViewProvider { View getView(Class<?> cls, Object o) { String path = getResourcePath(cls, o); if (path != null) { return resolveView(path); } else { return null; } } SpringViewResolverProvider(ViewResolver viewResolver, LocaleResolver localeResolver); void writeTo(Object o, Class<?> clazz, Type genericType, Annotation[] annotations, MediaType type,
            MultivaluedMap<String, Object> headers, OutputStream os);  }### Answer:
@Test public void testIsWriteableEnum() throws Exception { String viewName = "/test"; View view = expectGetView(viewName); viewResolver.setClassResources(Collections.singletonMap(TestEnum.class.getName() + "." + TestEnum.ONE, viewName)); replayAll(); assertTrue(viewResolver.isWriteable(TestEnum.ONE.getClass(), null, null, null)); assertEquals(view, viewResolver.getView(TestEnum.ONE.getClass(), TestEnum.ONE)); }
@Test public void testIsWriteableEnum2() { String viewName = "/test"; View view = expectGetView(viewName); viewResolver.setEnumResources(Collections.singletonMap(TestEnum.ONE, viewName)); replayAll(); assertTrue(viewResolver.isWriteable(TestEnum.ONE.getClass(), null, null, null)); assertEquals(view, viewResolver.getView(TestEnum.ONE.getClass(), TestEnum.ONE)); }