ServiceTools { public IJsonMarshaller getJsonMarshallerFromAnnotation(JsonUnmarshaller jua) throws JsonMarshallerException { if (jua != null) { return argumentServices.getIJsonMarshallerInstance(jua.value()); } return null; }  String getShortName(String fullformat); String getLiteralType(Type type); IJsonMarshaller getJsonMarshaller(Annotation[] annotations); IJsonMarshaller getJsonMarshallerFromAnnotation(JsonUnmarshaller jua); String getTemplateOfType(Type type, IJsonMarshaller jsonMarshaller); String getInstanceNameFromDataservice(Class cls); boolean isConsiderateMethod(Method method);  }
@Test public void testGetJsonMarshallerAnnotationPresent() throws InstantiationException, IllegalAccessException, JsonMarshallerException { System.out.println("getJsonMarshallerPresent"); JsonUnmarshaller ju = mock(JsonUnmarshaller.class); Class<? extends IJsonMarshaller> cls = LocaleMarshaller.class; when(ju.value()).thenReturn((Class) cls); when(argumentsServices.getIJsonMarshallerInstance(eq(cls))).thenReturn(cls.newInstance()); org.ocelotds.marshalling.IJsonMarshaller result = instance.getJsonMarshallerFromAnnotation(ju); assertThat(result).isInstanceOf(cls); result = instance.getJsonMarshallerFromAnnotation(null); assertThat(result).isNull(); }
@Test public void testGetJsonMarshallerAnnotationNotPresent() throws JsonMarshallerException { System.out.println("getJsonUnmarshallerNotPresent"); org.ocelotds.marshalling.IJsonMarshaller result = instance.getJsonMarshallerFromAnnotation(null); assertThat(result).isNull(); }