ServiceTools { public String getTemplateOfType(Type type, IJsonMarshaller jsonMarshaller) throws JsonMarshallerException { if (jsonMarshaller == null) { jsonMarshaller = argumentServices.getIJsonMarshallerInstance(TemplateMarshaller.class); } return _getTemplateOfType(type, jsonMarshaller); }  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 testGetTemplateOfType() throws JsonMarshallerException { System.out.println("getTemplateOfType"); Class type = String.class; org.ocelotds.marshalling.IJsonMarshaller ju = mock(org.ocelotds.marshalling.IJsonMarshaller.class); String expResult0 = "ok0"; String expResult1 = "ok1"; when(argumentsServices.getIJsonMarshallerInstance(any(Class.class))).thenReturn(mock(TemplateMarshaller.class)); doReturn(expResult0).when(instance)._getTemplateOfType(eq(type), any(TemplateMarshaller.class)); doReturn(expResult1).when(instance)._getTemplateOfType(eq(type), eq(ju)); String result = instance.getTemplateOfType(type, null); assertThat(result).isEqualTo(expResult0); result = instance.getTemplateOfType(type, ju); assertThat(result).isEqualTo(expResult1); }