GraphConfigurationServiceV2 implements IGraphConfigurationServiceV2 { @Override public Response getStoreTraits() { return Response.ok(graphFactory.getGraph().getStoreTraits()) .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 shouldGetStoreTraits() { final Set<StoreTrait> traits = (Set<StoreTrait>) service.getStoreTraits().getEntity(); assertNotNull(traits); assertEquals(6, traits.size(), "Collection size should be 6"); assertTrue(traits.contains(INGEST_AGGREGATION), "Collection should contain INGEST_AGGREGATION trait"); assertTrue(traits.contains(PRE_AGGREGATION_FILTERING), "Collection should contain PRE_AGGREGATION_FILTERING trait"); assertTrue(traits.contains(POST_AGGREGATION_FILTERING), "Collection should contain POST_AGGREGATION_FILTERING trait"); assertTrue(traits.contains(POST_TRANSFORMATION_FILTERING), "Collection should contain POST_TRANSFORMATION_FILTERING trait"); assertTrue(traits.contains(TRANSFORMATION), "Collection should contain TRANSFORMATION trait"); assertTrue(traits.contains(STORE_VALIDATION), "Collection should contain STORE_VALIDATION trait"); }
@Test public void shouldSerialiseAndDeserialiseGetStoreTraits() throws SerialisationException { byte[] bytes = JSONSerialiser.serialise(service.getStoreTraits().getEntity()); final Set<String> traits = JSONSerialiser.deserialise(bytes, Set.class); assertEquals(Sets.newHashSet( INGEST_AGGREGATION.name(), PRE_AGGREGATION_FILTERING.name(), POST_AGGREGATION_FILTERING.name(), POST_TRANSFORMATION_FILTERING.name(), TRANSFORMATION.name(), STORE_VALIDATION.name() ), traits); }