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));
}
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);
}
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);
}
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();
}
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");
}
Aggregations