DefaultSyncHandler implements SyncHandler { @NotNull @Override public SyncContext createContext(@NotNull ExternalIdentityProvider idp, @NotNull UserManager userManager, @NotNull ValueFactory valueFactory) { if (config.user().getDynamicMembership()) { return new DynamicSyncContext(config, idp, userManager, valueFactory); } else { return new DefaultSyncContext(config, idp, userManager, valueFactory); } } @SuppressWarnings("UnusedDeclaration")  DefaultSyncHandler();  DefaultSyncHandler(DefaultSyncConfig config); @NotNull @Override String getName(); @NotNull @Override SyncContext createContext(@NotNull ExternalIdentityProvider idp, @NotNull UserManager userManager,
                                     @NotNull ValueFactory valueFactory); @Override SyncedIdentity findIdentity(@NotNull UserManager userManager, @NotNull String id); @Override boolean requiresSync(@NotNull SyncedIdentity identity); @NotNull @Override Iterator<SyncedIdentity> listIdentities(@NotNull UserManager userManager);  }
@Test public void testCreateContext() { SyncContext ctx = syncHandler.createContext(idp, userManager, getValueFactory()); assertTrue(ctx instanceof DefaultSyncContext); }
@Test public void testLastSynced() throws Exception { sync(USER_ID, false); Authorizable a = userManager.getAuthorizable(USER_ID); a.removeProperty(DefaultSyncContext.REP_LAST_SYNCED); root.commit(); SyncContext ctx = syncHandler.createContext(idp, userManager, getValueFactory()); SyncResult res = ctx.sync(USER_ID); assertSame(SyncResult.Status.UPDATE, res.getStatus()); login(new SimpleCredentials(USER_ID, new char[0])).close(); root.commit(); }