Search in sources :

Example 1 with MemoryBackend

use of org.forgerock.opendj.ldap.MemoryBackend in project OpenAM by OpenRock.

the class IdRepoTestBase method setUpSuite.

@BeforeClass
public void setUpSuite() throws Exception {
    InjectorConfiguration.setGuiceModuleLoader(new GuiceModuleLoader() {

        @Override
        public Set<Class<? extends Module>> getGuiceModules(Class<? extends Annotation> aClass) {
            return Collections.<Class<? extends Module>>singleton(TestGuiceModule.class);
        }
    });
    PowerMockito.mockStatic(WebtopNaming.class);
    idRepoListener = PowerMockito.mock(IdRepoListener.class);
    when(WebtopNaming.getAMServerID()).thenReturn("01");
    when(WebtopNaming.getSiteID(eq("01"))).thenReturn("02");
    memoryBackend = decorateBackend(new MemoryBackend(new LDIFEntryReader(getClass().getResourceAsStream(getLDIFPath()))));
}
Also used : IdRepoListener(com.sun.identity.idm.IdRepoListener) Set(java.util.Set) LDIFEntryReader(org.forgerock.opendj.ldif.LDIFEntryReader) GuiceModuleLoader(org.forgerock.guice.core.GuiceModuleLoader) MemoryBackend(org.forgerock.opendj.ldap.MemoryBackend) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

IdRepoListener (com.sun.identity.idm.IdRepoListener)1 Set (java.util.Set)1 GuiceModuleLoader (org.forgerock.guice.core.GuiceModuleLoader)1 MemoryBackend (org.forgerock.opendj.ldap.MemoryBackend)1 LDIFEntryReader (org.forgerock.opendj.ldif.LDIFEntryReader)1 BeforeClass (org.testng.annotations.BeforeClass)1