GraphConfigurationServiceV2 implements IGraphConfigurationServiceV2 { @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Need to wrap all runtime exceptions before they are given to the user") @Override public Response getSerialisedFieldClasses(final String className) { return Response.ok(JsonSerialisationUtil.getSerialisedFieldClasses(className)) .header(GAFFER_MEDIA_TYPE_HEADER, GAFFER_MEDIA_TYPE) .build(); } GraphConfigurationServiceV2(); static void initialise(); @Override Response getSchema(); @Override Response getFilterFunction(); @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Need to wrap all runtime exceptions before they are given to the user") @Override Response getFilterFunction(final String inputClass); @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Need to wrap all runtime exceptions before they are given to the user") @Override Response getSerialisedFields(final String className); @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Need to wrap all runtime exceptions before they are given to the user") @Override Response getSerialisedFieldClasses(final String className); @Override Response getDescription(); @Override Response getTransformFunctions(); @Override Response getStoreTraits(); @Override Response getElementGenerators(); @Override Response getObjectGenerators();  }
@Test public void shouldGetCorrectSerialisedFieldsForEdgeClass() { final Map<String, String> fields = (Map<String, String>) service.getSerialisedFieldClasses(Edge.class.getName()).getEntity(); final Map<String, String> expectedFields = new HashMap<>(); expectedFields.put("class", Class.class.getName()); expectedFields.put("source", Object.class.getName()); expectedFields.put("destination", Object.class.getName()); expectedFields.put("matchedVertex", String.class.getName()); expectedFields.put("group", String.class.getName()); expectedFields.put("properties", Properties.class.getName()); expectedFields.put("directed", Boolean.class.getName()); expectedFields.put("directedType", String.class.getName()); assertEquals(expectedFields, fields); }
@Test public void shouldGetCorrectSerialisedFieldsForGetWalksClass() { final Map<String, String> fields = (Map<String, String>) service.getSerialisedFieldClasses(GetWalks.class.getName()).getEntity(); final Map<String, String> expectedFields = new HashMap<>(); expectedFields.put("operations", "java.util.List<uk.gov.gchq.gaffer.operation.io.Output<java.lang.Iterable<uk.gov.gchq.gaffer.data.element.Element>>>"); expectedFields.put("input", "java.lang.Object[]"); expectedFields.put("includePartial", "java.lang.Boolean"); expectedFields.put("options", "java.util.Map<java.lang.String,java.lang.String>"); expectedFields.put("resultsLimit", Integer.class.getName()); assertEquals(expectedFields, fields); }