use of org.pmiops.workbench.config.WorkbenchConfig in project workbench by all-of-us.
the class AuthInterceptorTest method setup.
@Before
public void setup() {
WorkbenchConfig workbenchConfig = new WorkbenchConfig();
workbenchConfig.googleDirectoryService = new GoogleDirectoryServiceConfig();
workbenchConfig.googleDirectoryService.gSuiteDomain = "fake-domain.org";
workbenchConfig.auth = new AuthConfig();
workbenchConfig.auth.serviceAccountApiUsers = new ArrayList<>();
workbenchConfig.auth.serviceAccountApiUsers.add("service-account@appspot.gserviceaccount.com");
this.interceptor = new AuthInterceptor(userInfoService, fireCloudService, Providers.of(workbenchConfig), userDao, userService);
this.user = new User();
user.setUserId(USER_ID);
user.setDisabled(false);
}
use of org.pmiops.workbench.config.WorkbenchConfig in project workbench by all-of-us.
the class ProfileControllerTest method testSubmitEverything_success.
@Test
public void testSubmitEverything_success() throws Exception {
createUser();
when(blockscoreService.createPerson(eq("Bob"), eq(null), any(Address.class), eq(null), eq(null), eq(null))).thenReturn(person);
when(mailChimpService.getMember(CONTACT_EMAIL)).thenReturn("subscribed");
when(person.getId()).thenReturn("id");
when(person.isValid()).thenReturn(true);
WorkbenchConfig testConfig = new WorkbenchConfig();
testConfig.firecloud = new FireCloudConfig();
testConfig.firecloud.registeredDomainName = "";
when(configProvider.get()).thenReturn(testConfig);
Profile profile = profileController.completeEthicsTraining().getBody();
assertThat(profile.getDataAccessLevel()).isEqualTo(DataAccessLevel.UNREGISTERED);
profile = profileController.submitDemographicsSurvey().getBody();
assertThat(profile.getDataAccessLevel()).isEqualTo(DataAccessLevel.UNREGISTERED);
profile = profileController.submitTermsOfService().getBody();
assertThat(profile.getDataAccessLevel()).isEqualTo(DataAccessLevel.UNREGISTERED);
profile = profileController.submitIdVerification(idVerificationRequest).getBody();
assertThat(profile.getDataAccessLevel()).isEqualTo(DataAccessLevel.REGISTERED);
verify(fireCloudService).addUserToGroup("bob@researchallofus.org", "");
assertThat(profile.getBlockscoreIdVerificationStatus()).isEqualTo(BlockscoreIdVerificationStatus.VERIFIED);
assertThat(profile.getDemographicSurveyCompletionTime()).isEqualTo(NOW.toEpochMilli());
assertThat(profile.getTermsOfServiceCompletionTime()).isEqualTo(NOW.toEpochMilli());
assertThat(profile.getEthicsTrainingCompletionTime()).isEqualTo(NOW.toEpochMilli());
}
use of org.pmiops.workbench.config.WorkbenchConfig in project workbench by all-of-us.
the class DirectoryServiceImplIntegrationTest method createConfig.
private static WorkbenchConfig createConfig() {
WorkbenchConfig config = new WorkbenchConfig();
config.googleDirectoryService = new WorkbenchConfig.GoogleDirectoryServiceConfig();
config.googleDirectoryService.gSuiteDomain = "fake-research-aou.org";
return config;
}
Aggregations