Search in sources :

Example 86 with BeforeMethod

use of org.testng.annotations.BeforeMethod in project OpenAM by OpenRock.

the class CTSQueueConfigurationTest method setup.

@BeforeMethod
public void setup() throws InvalidConfigurationException {
    mockConfigFactory = mock(ConnectionConfigFactory.class);
    mockConfig = mock(ConnectionConfig.class);
    given(mockConfigFactory.getConfig(any(ConnectionType.class))).willReturn(mockConfig);
    LdapDataLayerConfiguration dataLayerConfiguration = mock(LdapDataLayerConfiguration.class);
    given(dataLayerConfiguration.getStoreMode()).willReturn(StoreMode.DEFAULT);
    Map<ConnectionType, LdapDataLayerConfiguration> configMap = mock(Map.class);
    given(configMap.get(anyObject())).willReturn(dataLayerConfiguration);
    config = new CTSQueueConfiguration(mockConfigFactory, mock(Debug.class));
}
Also used : ConnectionType(org.forgerock.openam.sm.datalayer.api.ConnectionType) LdapDataLayerConfiguration(org.forgerock.openam.sm.datalayer.impl.ldap.LdapDataLayerConfiguration) ConnectionConfigFactory(org.forgerock.openam.sm.ConnectionConfigFactory) ConnectionConfig(org.forgerock.openam.sm.ConnectionConfig) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 87 with BeforeMethod

use of org.testng.annotations.BeforeMethod in project OpenAM by OpenRock.

the class OperationMonitorTest method setUp.

@BeforeMethod
public void setUp() {
    RateTimer timer = mock(RateTimer.class);
    rateWindow = mock(RateWindow.class);
    operationMonitor = new OperationMonitor(timer, rateWindow);
}
Also used : RateWindow(org.forgerock.openam.shared.monitoring.RateWindow) RateTimer(org.forgerock.openam.shared.monitoring.RateTimer) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 88 with BeforeMethod

use of org.testng.annotations.BeforeMethod in project OpenAM by OpenRock.

the class LdapSearchHandlerTest method setUp.

@BeforeMethod
public void setUp() throws Exception {
    mockConnection = mock(Connection.class);
    mockRequest = mock(SearchRequest.class);
    debug = mock(Debug.class);
    handler = new LdapSearchHandler(new CTSDataLayerConfiguration("ou=test-case"), debug);
}
Also used : SearchRequest(org.forgerock.opendj.ldap.requests.SearchRequest) Connection(org.forgerock.opendj.ldap.Connection) LdapSearchHandler(org.forgerock.openam.sm.datalayer.impl.ldap.LdapSearchHandler) Debug(com.sun.identity.shared.debug.Debug) CTSDataLayerConfiguration(org.forgerock.openam.cts.impl.CTSDataLayerConfiguration) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 89 with BeforeMethod

use of org.testng.annotations.BeforeMethod in project OpenAM by OpenRock.

the class RestRouterIT method setupGuiceModules.

@BeforeMethod(dependsOnMethods = "setupMocks")
@Override
public void setupGuiceModules() throws Exception {
    InjectorConfiguration.setGuiceModuleLoader(new GuiceModuleLoader() {

        @Override
        public Set<Class<? extends Module>> getGuiceModules(Class<? extends Annotation> clazz) {
            return new HashSet<>();
        }
    });
    super.setupGuiceModules();
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) GuiceModuleLoader(org.forgerock.guice.core.GuiceModuleLoader) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 90 with BeforeMethod

use of org.testng.annotations.BeforeMethod in project OpenAM by OpenRock.

the class PrivilegeAuthzModuleTest method setUp.

@BeforeMethod
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    final Map<String, PrivilegeDefinition> definitions = new HashMap<>();
    definitions.put("evaluate", PrivilegeDefinition.getInstance("evaluate", PrivilegeDefinition.Action.READ));
    definitions.put("blowup", PrivilegeDefinition.getInstance("destroy", PrivilegeDefinition.Action.MODIFY));
    given(session.getClientDomain()).willReturn("/abc");
    given(token.getTokenID()).willReturn(tokenID);
    given(coreWrapper.convertOrgNameToRealmName("realmdn")).willReturn("/abc");
    given(sessionCache.getSession(any(SessionID.class))).willReturn(session);
    module = new PrivilegeAuthzModule(evaluator, definitions, factory, sessionCache, coreWrapper);
    Session session = mock(Session.class);
    given(subjectContext.getCallerSession()).willReturn(session);
    given(session.getClientDomain()).willReturn("realmdn");
}
Also used : HashMap(java.util.HashMap) Matchers.anyString(org.mockito.Matchers.anyString) SessionID(com.iplanet.dpro.session.SessionID) Session(com.iplanet.dpro.session.Session) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

BeforeMethod (org.testng.annotations.BeforeMethod)1078 File (java.io.File)60 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)52 IOException (java.io.IOException)49 DateTime (org.joda.time.DateTime)46 NavigationHelper (org.mifos.test.acceptance.framework.testhelpers.NavigationHelper)42 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)41 LoanTestHelper (org.mifos.test.acceptance.framework.testhelpers.LoanTestHelper)38 Enumeration (java.util.Enumeration)37 Project (com.google.refine.model.Project)33 StringWriter (java.io.StringWriter)26 Properties (java.util.Properties)26 EntityType (org.molgenis.data.meta.model.EntityType)25 ODatabaseDocumentTx (com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx)23 ServletConfig (jakarta.servlet.ServletConfig)22 ServletContext (jakarta.servlet.ServletContext)22 HttpServletRequest (javax.servlet.http.HttpServletRequest)22 AppLauncher (org.mifos.test.acceptance.framework.AppLauncher)22 Subject (javax.security.auth.Subject)21 Attribute (org.molgenis.data.meta.model.Attribute)21