use of org.testng.annotations.BeforeMethod in project OpenAM by OpenRock.
the class RestRouterIT method setupMocks.
@BeforeMethod
public void setupMocks() {
MockitoAnnotations.initMocks(this);
configResource = mock(SingletonResourceProvider.class);
usersResource = mock(CollectionResourceProvider.class);
internalResource = mock(CollectionResourceProvider.class);
dashboardResource = spy(new DashboardResource());
authenticateResource = spy(new AuthenticateResource());
httpAccessAuditFilter = spy(new AbstractHttpAccessAuditFilter(AUTHENTICATION, mock(AuditEventPublisher.class), mock(AuditEventFactory.class)) {
@Override
protected String getRealm(Context context) {
return null;
}
});
auditEventPublisher = mock(AuditEventPublisher.class);
auditServiceProvider = mock(AuditServiceProvider.class);
versionBehaviourManager = mock(ResourceApiVersionBehaviourManager.class);
ssoTokenManager = mock(SSOTokenManager.class);
authUtilsWrapper = mock(AuthUtilsWrapper.class);
coreWrapper = mock(CoreWrapper.class);
SSOToken adminToken = mock(SSOToken.class);
given(coreWrapper.getAdminToken()).willReturn(adminToken);
given(coreWrapper.isValidFQDN(anyString())).willReturn(true);
realmValidator = mock(RestRealmValidator.class);
}
use of org.testng.annotations.BeforeMethod in project OpenAM by OpenRock.
the class ScriptConfigurationServiceTest method setUp.
@BeforeMethod
public void setUp() throws ResourceException {
Logger logger = mock(Logger.class);
Subject subject = new Subject();
subject.getPrincipals().add(testUserPrinciple);
dataStore = mock(ScriptingDataStore.class);
ScriptingDataStoreFactory dataStoreFactory = mock(ScriptingDataStoreFactory.class);
when(dataStoreFactory.create(any(Subject.class), anyString())).thenReturn(dataStore);
service = new ScriptConfigurationService(logger, subject, "/", dataStoreFactory);
}
use of org.testng.annotations.BeforeMethod in project OpenAM by OpenRock.
the class AttributeCompressionStrategyTest method setup.
@BeforeMethod
public void setup() {
blobUtils = new TokenBlobUtils();
compression = new AttributeCompressionStrategy(blobUtils);
}
use of org.testng.annotations.BeforeMethod in project OpenAM by OpenRock.
the class XACMLSchemaFactoryTest method setup.
@BeforeMethod
public void setup() throws EntitlementException {
xacmlSchemaFactory = new XACMLSchemaFactory();
resourceAttributeUtil = new ResourceAttributeUtil();
PolicyResponseProvider rp1 = createPolicyResponseProvider(1);
PolicyResponseProvider rp2 = createPolicyResponseProvider(2);
PolicyResponseProvider rp3 = createPolicyResponseProvider(3);
PolicyResponseProvider rp4 = createPolicyResponseProvider(4);
rpSet = CollectionUtils.asSet(rp1, rp2, rp3, rp4);
AdviceExpression ae1 = createAdviceExpression(rp1);
AdviceExpression ae2 = createAdviceExpression(rp2);
AdviceExpression ae3 = createAdviceExpression(rp3);
AdviceExpression ae4 = createAdviceExpression(rp4);
aes = new AdviceExpressions();
aes.getAdviceExpression().addAll(Arrays.asList(ae1, ae2, ae3, ae4));
}
use of org.testng.annotations.BeforeMethod in project OpenAM by OpenRock.
the class AMIdentityMembershipConditionTest method setUp.
@BeforeMethod
public void setUp() {
Debug debug = mock(Debug.class);
coreWrapper = mock(CoreWrapper.class);
condition = new AMIdentityMembershipCondition(debug, coreWrapper);
adminToken = mock(SSOToken.class);
given(coreWrapper.getAdminToken()).willReturn(adminToken);
}
Aggregations