Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: improvements to Report Schema tests #117

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

sofia-gomes-onfido
Copy link
Contributor

@sofia-gomes-onfido sofia-gomes-onfido commented Jun 19, 2024

Use getReportShared() to access getStatus() method instead of getActualInstance() in repeatRequestUntilStatusChanges method.

@sofia-gomes-onfido sofia-gomes-onfido marked this pull request as ready for review June 20, 2024 10:38
@@ -188,12 +189,12 @@ public Object repeatRequestUntilStatusChanges(
Thread.sleep(sleepTime);

if (isInstanceOfReport) {
instance = ((Report) method.invoke(onfido, params)).getActualInstance();
instance = ((Report) method.invoke(onfido, params)).getReportShared();
Copy link
Contributor

@dvacca-onfido dvacca-onfido Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this should be enough:

Suggested change
instance = ((Report) method.invoke(onfido, params)).getReportShared();
instance = (Report) method.invoke(onfido, params);

Assertions.assertNotNull(documentReport.getResult());
Assertions.assertNotNull(documentReport.getSubResult());
Assertions.assertEquals(check.getId(), documentReport.getReportShared().getCheckId());
Assertions.assertNotNull(((DocumentReport) documentReport.getActualInstance()).getBreakdown());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to call getActualInstance() and cast the result. Just calling getDocumentReport() (or getFacialSimilarityPhotoFullyAutoReport() later on) would do the trick. ;)

@sofia-gomes-onfido sofia-gomes-onfido merged commit 01565b4 into master Jun 24, 2024
2 checks passed
@sofia-gomes-onfido sofia-gomes-onfido deleted the test-improvements branch June 24, 2024 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants