FederatedStore extends Store { @Override public void initialise(final String graphId, final Schema unused, final StoreProperties properties) throws StoreException { super.initialise(graphId, new Schema(), properties); customPropertiesAuths = getCustomPropertiesAuths(); isPublicAccessAllowed = Boolean.valueOf(getProperties().getIsPublicAccessAllowed()); } FederatedStore(); @Override void initialise(final String graphId, final Schema unused, final StoreProperties properties); @Override void setGraphLibrary(final GraphLibrary library); @Override FederatedStoreProperties getProperties(); @Deprecated static OP updateOperationForGraph(final OP operation, final Graph graph); void addGraphs(final Set<String> graphAuths, final String addingUserId, final boolean isPublic, final GraphSerialisable... graphs); void addGraphs(
            final Set<String> graphAuths,
            final String addingUserId,
            final boolean isPublic,
            final boolean disabledByDefault,
            final GraphSerialisable... graphs); void addGraphs(
            final Set<String> graphAuths,
            final String addingUserId,
            final boolean isPublic,
            final boolean disabledByDefault,
            final AccessPredicate readAccessPredicate,
            final AccessPredicate writeAccessPredicate,
            final GraphSerialisable... graphs); void addGraphs(final FederatedAccess access, final GraphSerialisable... graphs); @Deprecated void addGraphs(final Set<String> graphAuths, final String addingUserId, final GraphSerialisable... graphs); boolean remove(final String graphId, final User user); boolean remove(final String graphId, final User user, final boolean asAdmin); Collection<String> getAllGraphIds(final User user); Collection<String> getAllGraphIds(final User user, final boolean asAdmin); @Override Schema getSchema(); Schema getSchema(final GetSchema operation, final Context context); Schema getSchema(final Operation operation, final Context context); Schema getSchema(final Map<String, String> config, final Context context); Schema getSchema(final Operation operation, final User user); Schema getSchema(final Map<String, String> config, final User user); @Override Set<StoreTrait> getTraits(); Set<StoreTrait> getTraits(final GetTraits getTraits, final Context context); Collection<Graph> getGraphs(final User user, final String graphIdsCsv, final Operation operation); Map<String, Object> getAllGraphsAndAuths(final User user, final String graphIdsCsv); Map<String, Object> getAllGraphsAndAuths(final User user, final String graphIdsCsv, final boolean isAdmin); boolean isLimitedToLibraryProperties(final User user); boolean changeGraphAccess(final User requestingUser, final String graphId, final FederatedAccess federatedAccess, final boolean isAdmin); boolean changeGraphId(final User requestingUser, final String graphId, final String newGraphId, final boolean isAdmin);  }
@Test public void shouldNotUseSchema() throws Exception { final Schema unusedMock = Mockito.mock(Schema.class); store.initialise(FEDERATED_STORE_ID, unusedMock, federatedProperties); addGraphWithPaths(ACC_ID_2, PROPERTIES_ALT, PATH_BASIC_EDGE_SCHEMA_JSON); Mockito.verifyNoMoreInteractions(unusedMock); }
@Test public void shouldThrowExceptionWithInvalidCacheClass() throws StoreException { federatedProperties.setCacheProperties(INVALID_CACHE_SERVICE_CLASS_STRING); try { clearCache(); store.initialise(FEDERATED_STORE_ID, null, federatedProperties); fail(EXCEPTION_NOT_THROWN); } catch (final IllegalArgumentException e) { assertTrue(e.getMessage().contains("Failed to instantiate cache")); } }
@Test public void shouldInitialiseWithCache() throws StoreException { assertNull(CacheServiceLoader.getService()); federatedProperties.setCacheProperties(CACHE_SERVICE_CLASS_STRING); assertNull(CacheServiceLoader.getService()); store.initialise(FEDERATED_STORE_ID, null, federatedProperties); assertNotNull(CacheServiceLoader.getService()); }
@Test public void shouldNotThrowExceptionWhenInitialisedWithNoCacheClassInProperties() throws StoreException { federatedProperties = new FederatedStoreProperties(); try { store.initialise(FEDERATED_STORE_ID, null, federatedProperties); } catch (final StoreException e) { fail("FederatedStore does not have to have a cache."); } }