use of org.testng.annotations.BeforeTest in project rest.li by linkedin.
the class TestRestLiMethodInvocation method setUp.
@BeforeTest
protected void setUp() {
_scheduler = Executors.newSingleThreadScheduledExecutor();
_engine = new EngineBuilder().setTaskExecutor(_scheduler).setTimerScheduler(_scheduler).build();
_resourceFactory = new EasyMockResourceFactory();
_errorResponseBuilder = new ErrorResponseBuilder();
_methodAdapterRegistry = new MethodAdapterRegistry(_errorResponseBuilder);
// Add filters to the invoker.
_invoker = new RestLiMethodInvoker(_resourceFactory, _engine, _errorResponseBuilder);
}
use of org.testng.annotations.BeforeTest in project OpenAM by OpenRock.
the class JwtAttributeMapperTest method initialize.
@BeforeTest
public void initialize() {
jwtMappings = new HashMap<String, Object>();
jwtMappings.put(SUB, SUBJECT_VALUE);
jwtMappings.put(ISS, ISSUER);
jwtMappings.put(EMAIL, EMAIL_VALUE);
attributeMappings = new HashMap<String, String>();
attributeMappings.put(SUB, UID);
attributeMappings.put(EMAIL, AM_EMAIL);
claimsSet = new JwtClaimsSet(jwtMappings);
defaultPrincipalMapper = new JwtAttributeMapper("uid", "prefix-");
}
use of org.testng.annotations.BeforeTest in project OpenAM by OpenRock.
the class SAML2ProxyTest method theSetUp.
@BeforeTest
void theSetUp() {
//you need this
validCookies = new Cookie[1];
validCookies[0] = new Cookie(AM_LOCATION_COOKIE, COOKIE_LOCATION);
}
use of org.testng.annotations.BeforeTest in project OpenAM by OpenRock.
the class ClientResourceTest method setUp.
@BeforeTest
public void setUp() throws SMSException {
mockManager = mock(ClientResourceManager.class);
ServiceSchemaManager mockSchemaManager = mock(ServiceSchemaManager.class);
ServiceSchema mockSchema = mock(ServiceSchema.class);
mockSubSchema = mock(ServiceSchema.class);
Mockito.doReturn(mockSchema).when(mockSchemaManager).getOrganizationSchema();
Mockito.doReturn(mockSubSchema).when(mockSchema).getSubSchema(anyString());
resource = new ClientResource(mockManager, mock(CTSPersistentStore.class), mockSchemaManager, mock(OAuth2AuditLogger.class), mock(Debug.class));
}
use of org.testng.annotations.BeforeTest in project OpenAM by OpenRock.
the class SoapSTSInstanceStateServiceListenerTest method setUpTest.
@BeforeTest
public void setUpTest() {
final Injector injector = Guice.createInjector(new TestModule());
provider = injector.getInstance(SoapSTSInstanceStateProvider.class);
serviceListener = injector.getInstance(Key.get(ServiceListener.class, Names.named(TokenGenerationModule.SOAP_STS_INSTANCE_STATE_LISTENER)));
}
Aggregations