GraphConfigurationService implements IGraphConfigurationService { @Override public Set<StoreTrait> getStoreTraits() { return graphFactory.getGraph().getStoreTraits(); } GraphConfigurationService(); static void initialise(); @Override Schema getSchema(); @Override String getDescription(); @Override Set<Class> getFilterFunctions(); @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Need to wrap all runtime exceptions before they are given to the user") @Override Set<Class> getFilterFunctions(final String inputClass); @SuppressFBWarnings(value = "REC_CATCH_EXCEPTION", justification = "Need to wrap all runtime exceptions before they are given to the user") @Override Set<String> getSerialisedFields(final String className); @Override Set<Class> getTransformFunctions(); @Override Set<StoreTrait> getStoreTraits(); @Override Set<Class> getNextOperations(final String operationClassName); @Override Set<Class> getElementGenerators(); @Override Set<Class> getObjectGenerators(); @Override Set<Class> getOperations(); @Override Boolean isOperationSupported(final Class operation);  }
@Test public void shouldGetStoreTraits() throws IOException { final Set<StoreTrait> traits = service.getStoreTraits(); assertNotNull(traits); assertTrue(traits.size() == 6, "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 IOException { byte[] bytes = JSONSerialiser.serialise(service.getStoreTraits()); final Set<StoreTrait> traits = JSONSerialiser.deserialise(bytes, Set.class); assertNotNull(traits); assertEquals(6, traits.size(), "Collection size should be 6"); assertTrue(traits.contains(INGEST_AGGREGATION.name()), "Collection should contain INGEST_AGGREGATION trait"); assertTrue(traits.contains(PRE_AGGREGATION_FILTERING.name()), "Collection should contain PRE_AGGREGATION_FILTERING trait"); assertTrue(traits.contains(POST_AGGREGATION_FILTERING.name()), "Collection should contain POST_AGGREGATION_FILTERING trait"); assertTrue(traits.contains(POST_TRANSFORMATION_FILTERING.name()), "Collection should contain POST_TRANSFORMATION_FILTERING trait"); assertTrue(traits.contains(TRANSFORMATION.name()), "Collection should contain TRANSFORMATION trait"); assertTrue(traits.contains(STORE_VALIDATION.name()), "Collection should contain STORE_VALIDATION trait"); }