-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[no ticket][risk=no] Supplemented creator information (#8969)
- Loading branch information
Showing
18 changed files
with
86 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ | |
import org.pmiops.workbench.db.model.DbWorkspace; | ||
import org.pmiops.workbench.model.BillingStatus; | ||
import org.pmiops.workbench.model.ResearchPurpose; | ||
import org.pmiops.workbench.model.User; | ||
import org.pmiops.workbench.model.Workspace; | ||
import org.pmiops.workbench.model.WorkspaceAccessLevel; | ||
import org.pmiops.workbench.utils.mappers.CommonMappers; | ||
|
@@ -113,14 +114,17 @@ public void setUp() { | |
.researchOutcomeList(Collections.emptyList()); | ||
final long now = System.currentTimeMillis(); | ||
|
||
User creator = new User(); | ||
creator.setUserName("[email protected]"); | ||
|
||
workspace1 = | ||
new Workspace() | ||
.etag("etag_1") | ||
.name("DbWorkspace 1") | ||
.terraName("dbworkspace1") | ||
.namespace("aou-rw-local1-c4be869a") | ||
.cdrVersionId("1") | ||
.creator("[email protected]") | ||
.creatorUser(creator) | ||
.billingAccountName("big-bux") | ||
.googleBucketName("bucket o' science") | ||
.accessTierShortName(AccessTierService.REGISTERED_TIER_SHORT_NAME) | ||
|
@@ -279,6 +283,8 @@ public void testFireEditAction_sendsChangedProperties() { | |
.timeReviewed(workspace1.getResearchPurpose().getTimeReviewed() + 1000L) | ||
.controlSet(!workspace1.getResearchPurpose().isControlSet()); | ||
final int rpChanges = 5; | ||
User creator = new User(); | ||
creator.setUserName("[email protected]"); | ||
|
||
Workspace editedWorkspace = | ||
clone(workspace1) | ||
|
@@ -287,7 +293,7 @@ public void testFireEditAction_sendsChangedProperties() { | |
// changes | ||
.name("a new name") | ||
.namespace("a new namespace") | ||
.creator("[email protected]"); | ||
.creatorUser(creator); | ||
final int wsChanges = 3; | ||
|
||
workspaceAuditor.fireEditAction(workspace1, editedWorkspace, dbWorkspace1.getWorkspaceId()); | ||
|
@@ -304,7 +310,7 @@ private Workspace clone(Workspace in) { | |
.name(in.getName()) | ||
.namespace(in.getNamespace()) | ||
.cdrVersionId(in.getCdrVersionId()) | ||
.creator(in.getCreator()) | ||
.creatorUser(in.getCreatorUser()) | ||
.billingAccountName(in.getBillingAccountName()) | ||
.googleBucketName(in.getGoogleBucketName()) | ||
.accessTierShortName(in.getAccessTierShortName()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
import org.pmiops.workbench.access.AccessTierService; | ||
import org.pmiops.workbench.model.ResearchPurpose; | ||
import org.pmiops.workbench.model.SpecificPopulationEnum; | ||
import org.pmiops.workbench.model.User; | ||
import org.pmiops.workbench.model.Workspace; | ||
|
||
class TargetPropertyExtractorTest { | ||
|
@@ -16,6 +17,8 @@ class TargetPropertyExtractorTest { | |
@BeforeEach | ||
void setUp() { | ||
long now = System.currentTimeMillis(); | ||
User creator = new User(); | ||
creator.setUserName("[email protected]"); | ||
|
||
var researchPurpose1 = | ||
new ResearchPurpose() | ||
|
@@ -52,7 +55,7 @@ void setUp() { | |
.terraName("dbworkspace1") | ||
.namespace("aou-rw-local1-c4be869a") | ||
.cdrVersionId("1") | ||
.creator("[email protected]") | ||
.creatorUser(creator) | ||
.accessTierShortName(AccessTierService.REGISTERED_TIER_SHORT_NAME) | ||
.researchPurpose(researchPurpose1); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
import org.pmiops.workbench.access.AccessTierService; | ||
import org.pmiops.workbench.model.ResearchPurpose; | ||
import org.pmiops.workbench.model.SpecificPopulationEnum; | ||
import org.pmiops.workbench.model.User; | ||
import org.pmiops.workbench.model.Workspace; | ||
|
||
public class WorkspaceTargetPropertyTest { | ||
|
@@ -42,13 +43,15 @@ public void setUp() { | |
.anticipatedFindings("a 4-leaf clover"); | ||
|
||
long now = System.currentTimeMillis(); | ||
User creator = new User(); | ||
creator.setUserName("[email protected]"); | ||
|
||
workspace1 = | ||
new Workspace() | ||
.name("Workspace 1") | ||
.terraName("workspace1") | ||
.namespace("aou-rw-local1-c4be869a") | ||
.creator("[email protected]") | ||
.creatorUser(creator) | ||
.cdrVersionId("1") | ||
.researchPurpose(researchPurposeAllFieldsPopulated) | ||
.creationTime(now) | ||
|
@@ -61,7 +64,7 @@ public void setUp() { | |
.name("Workspace 2") | ||
.terraName("workspace2") | ||
.namespace("aou-rw-local1-c4be869a") | ||
.creator("[email protected]") | ||
.creatorUser(creator) | ||
.cdrVersionId("33") | ||
.researchPurpose(researchPurpose2) | ||
.creationTime(now) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,7 @@ | |
import org.pmiops.workbench.model.ResearchPurpose; | ||
import org.pmiops.workbench.model.SexAtBirthV2; | ||
import org.pmiops.workbench.model.SexualOrientationV2; | ||
import org.pmiops.workbench.model.User; | ||
import org.pmiops.workbench.model.Workspace; | ||
import org.pmiops.workbench.model.YesNoPreferNot; | ||
import org.pmiops.workbench.rawls.model.RawlsWorkspaceAccessLevel; | ||
|
@@ -119,6 +120,11 @@ public static Workspace createWorkspace( | |
List<ResearchOutcomeEnum> ResearchOutcomeEnumsList = new ArrayList<>(); | ||
ResearchOutcomeEnumsList.add(ResearchOutcomeEnum.IMPROVED_RISK_ASSESMENT); | ||
|
||
User creator = new User(); | ||
creator.setUserName("[email protected]"); | ||
creator.setGivenName("Jay"); | ||
creator.setFamilyName("Tester"); | ||
|
||
return new Workspace() | ||
.etag("\"1\"") | ||
.name(workspaceDisplayName) | ||
|
@@ -131,7 +137,7 @@ public static Workspace createWorkspace( | |
.billingAccountName(WORKSPACE_BILLING_ACCOUNT_NAME) | ||
.googleProject(DEFAULT_GOOGLE_PROJECT) | ||
.creationTime(1588097211621L) | ||
.creator("[email protected]") | ||
.creatorUser(creator) | ||
.creationTime(Instant.parse("2000-01-01T00:00:00.00Z").toEpochMilli()) | ||
.lastModifiedTime(1588097211621L) | ||
.googleProject(DEFAULT_GOOGLE_PROJECT) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,8 @@ | |
public class WorkspaceMapperTest { | ||
private static final String FIRECLOUD_NAMESPACE = "aou-xxxxxxx"; | ||
private static final String CREATOR_EMAIL = "[email protected]"; | ||
private static final String CREATOR_GIVEN_NAME = "Oscar"; | ||
private static final String CREATOR_FAMILY_NAME = "Calhoun"; | ||
private static final long CREATOR_USER_ID = 101L; | ||
private static final long WORKSPACE_DB_ID = 222L; | ||
private static final int WORKSPACE_VERSION = 2; | ||
|
@@ -145,6 +147,8 @@ public void setUp() { | |
final DbUser creatorUser = | ||
new DbUser() | ||
.setUsername(CREATOR_EMAIL) | ||
.setGivenName(CREATOR_GIVEN_NAME) | ||
.setFamilyName(CREATOR_FAMILY_NAME) | ||
.setUserId(CREATOR_USER_ID) | ||
.setUserInitialCreditsExpiration( | ||
new DbUserInitialCreditsExpiration() | ||
|
@@ -213,7 +217,9 @@ public void testConvertsDbToApiWorkspace() { | |
assertThat(ws.getName()).isEqualTo(WORKSPACE_AOU_NAME); | ||
assertThat(ws.getNamespace()).isEqualTo(FIRECLOUD_NAMESPACE); | ||
assertThat(ws.getCdrVersionId()).isEqualTo(Long.toString(CDR_VERSION_ID)); | ||
assertThat(ws.getCreator()).isEqualTo(CREATOR_EMAIL); | ||
assertThat(ws.getCreatorUser().getUserName()).isEqualTo(CREATOR_EMAIL); | ||
assertThat(ws.getCreatorUser().getGivenName()).isEqualTo(CREATOR_GIVEN_NAME); | ||
assertThat(ws.getCreatorUser().getFamilyName()).isEqualTo(CREATOR_FAMILY_NAME); | ||
assertThat(ws.getInitialCredits().getExpirationEpochMillis()) | ||
.isEqualTo(INITIAL_CREDITS_EXPIRATION_TIMESTAMP.getTime()); | ||
assertThat(ws.getGoogleBucketName()).isEqualTo(FIRECLOUD_BUCKET_NAME); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.