Skip to content

Commit

Permalink
fix:added delay to allow email to be created
Browse files Browse the repository at this point in the history
  • Loading branch information
sr4850 committed Apr 9, 2024
1 parent 1ec1fb8 commit aaaa750
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.dvsa.testing.lib</groupId>
<artifactId>active-support</artifactId>
<version>2.0.1.7</version>
<version>2.0.1.8</version>

<properties>
<nexus.releases>https://nexus.olcs.dev-dvsacloud.uk/repository/maven-releases</nexus.releases>
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/activesupport/aws/s3/S3.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ public static String getTempPassword(@NotNull String emailAddress, @NotNull Stri
}


public static String getGovSignInCode(String sesBucketName, String sesBucketPath) throws MissingRequiredArgument {
public static String getGovSignInCode(String sesBucketName, String sesBucketPath) throws MissingRequiredArgument, InterruptedException {
TimeUnit.SECONDS.sleep(10L);
String lastModified = listObjectsByLastModified(sesBucketName, sesBucketPath);
if (client().doesObjectExist(sesBucketName, lastModified)) {
S3Object s3Object = client().getObject(sesBucketName, lastModified);
Expand All @@ -102,7 +103,7 @@ public static String getGovSignInCode(String sesBucketName, String sesBucketPath
}
}

public static String getSignInCode() {
public static String getSignInCode() throws InterruptedException {
return getGovSignInCode(sesBucketName, sesBucketPath);
}

Expand Down Expand Up @@ -158,6 +159,15 @@ public static String getUsernameInfoLink(@NotNull String emailAddress) throws Mi
return extractUsernameFromS3Object(s3Object);
}

public static String getForgottenUsernameInfoLink(@NotNull String emailAddress) throws MissingRequiredArgument {
String S3ObjectName = Util.s3RetrieveObject(emailAddress, "__Your_account_information");
String stringCap = S3ObjectName.substring(0, Math.min(S3ObjectName.length(), 100));
String s3Path = Util.s3Path(stringCap);
S3Object s3Object = getS3Object(s3BucketName, s3Path);
return extractUsernameFromS3Object(s3Object);
}



public static boolean checkLastTMLetterAttachment(@NotNull String emailAddress, String licenceNo) throws MissingRequiredArgument {
S3Object emailObject = getTMLastLetterEmail(emailAddress);
Expand Down

0 comments on commit aaaa750

Please sign in to comment.