diff --git a/src/test/java/com/onfido/integration/AddressTest.java b/src/test/java/com/onfido/integration/AddressTest.java index e6760e4..d646e9d 100644 --- a/src/test/java/com/onfido/integration/AddressTest.java +++ b/src/test/java/com/onfido/integration/AddressTest.java @@ -14,5 +14,7 @@ public void pickTest() throws Exception { Assertions.assertNotNull(addresses); Assertions.assertEquals("S2 2DF", addresses.get(0).getPostcode()); Assertions.assertEquals("S2 2DF", addresses.get(1).getPostcode()); + + Assertions.assertNotNull(addresses.get(0).toJson()); } } diff --git a/src/test/java/com/onfido/integration/ApplicantTest.java b/src/test/java/com/onfido/integration/ApplicantTest.java index 340f3c7..22aae9a 100644 --- a/src/test/java/com/onfido/integration/ApplicantTest.java +++ b/src/test/java/com/onfido/integration/ApplicantTest.java @@ -29,6 +29,8 @@ public void createApplicantTest() throws Exception { Assertions.assertEquals("First", applicant.getFirstName()); Assertions.assertEquals("Last", applicant.getLastName()); + + Assertions.assertNotNull(applicant.toJson()); } @Test @@ -38,6 +40,8 @@ public void findApplicantTest() throws Exception { Assertions.assertEquals("First", lookupApplicant.getFirstName()); Assertions.assertEquals("Last", lookupApplicant.getLastName()); + + Assertions.assertNotNull(lookupApplicant.toJson()); } @Test @@ -47,6 +51,8 @@ public void updateApplicantTest() throws Exception { Assertions.assertEquals("Updated", updatedApplicant.getFirstName()); Assertions.assertEquals("Last", updatedApplicant.getLastName()); + + Assertions.assertNotNull(updatedApplicant.toJson()); } @Test @@ -76,5 +82,8 @@ public void listApplicants() throws Exception { Assertions.assertEquals("Applicant1", applicants.get(0).getFirstName()); Assertions.assertEquals("Applicant2", applicants.get(1).getFirstName()); + + Assertions.assertNotNull(applicants.get(0).toJson()); + Assertions.assertNotNull(applicants.get(1).toJson()); } } diff --git a/src/test/java/com/onfido/integration/CheckTest.java b/src/test/java/com/onfido/integration/CheckTest.java index f1b0278..a34481e 100644 --- a/src/test/java/com/onfido/integration/CheckTest.java +++ b/src/test/java/com/onfido/integration/CheckTest.java @@ -33,6 +33,8 @@ public void createCheckTest() throws Exception { Assertions.assertEquals(applicant.getId(), check.getApplicantId()); Assertions.assertEquals(null, check.getWebhookIds()); + + Assertions.assertNotNull(check.toJson()); } @Test @@ -85,6 +87,8 @@ public void findCheckTest() throws Exception { Check lookupCheck = onfido.findCheck(check.getId()); Assertions.assertEquals(check.getApplicantId(), lookupCheck.getApplicantId()); + + Assertions.assertNotNull(check.toJson()); } @Test @@ -96,6 +100,8 @@ public void listChecks() throws Exception { Assertions.assertEquals(applicant.getId(), checks.get(0).getApplicantId()); Assertions.assertEquals(1, checks.size()); + + Assertions.assertNotNull(checks.get(0).toJson()); } @Test diff --git a/src/test/java/com/onfido/integration/DocumentTest.java b/src/test/java/com/onfido/integration/DocumentTest.java index bda45db..885e35a 100644 --- a/src/test/java/com/onfido/integration/DocumentTest.java +++ b/src/test/java/com/onfido/integration/DocumentTest.java @@ -25,6 +25,8 @@ public void setupTest() throws Exception { @Test public void uploadDocumentTest() throws Exception { Assertions.assertEquals("sample_driving_licence.png", document.getFileName()); + + Assertions.assertNotNull(document.toJson()); } @Test @@ -51,6 +53,7 @@ public void findDocumentTest() throws Exception { Document lookupDocument = onfido.findDocument(document.getId()); Assertions.assertEquals("sample_driving_licence.png", lookupDocument.getFileName()); + Assertions.assertNotNull(lookupDocument.toJson()); } @Test @@ -66,6 +69,9 @@ public void listDocumentsTest() throws Exception { Assertions.assertEquals(FileTypeEnum.JPEG, documents.get(0).getFileType()); Assertions.assertEquals("sample_driving_licence.png", documents.get(1).getFileName()); Assertions.assertEquals(FileTypeEnum.PNG, documents.get(1).getFileType()); + + Assertions.assertNotNull(documents.get(0).toJson()); + Assertions.assertNotNull(documents.get(1).toJson()); } @Test diff --git a/src/test/java/com/onfido/integration/ExtractionTest.java b/src/test/java/com/onfido/integration/ExtractionTest.java index be4128c..ae2ad4b 100644 --- a/src/test/java/com/onfido/integration/ExtractionTest.java +++ b/src/test/java/com/onfido/integration/ExtractionTest.java @@ -50,5 +50,9 @@ public void performExtractionTest() throws Exception { Assertions.assertEquals("SARAH", extractedData.getFirstName()); Assertions.assertEquals("MORGAN", extractedData.getLastName()); Assertions.assertEquals(GenderEnum.FEMALE, extractedData.getGender()); + + Assertions.assertNotNull(extraction.toJson()); + Assertions.assertNotNull(documentClassification.toJson()); + Assertions.assertNotNull(extractedData.toJson()); } } diff --git a/src/test/java/com/onfido/integration/IdPhotoTest.java b/src/test/java/com/onfido/integration/IdPhotoTest.java index 4bfafe1..d7dba1c 100644 --- a/src/test/java/com/onfido/integration/IdPhotoTest.java +++ b/src/test/java/com/onfido/integration/IdPhotoTest.java @@ -25,6 +25,8 @@ public void setupTest() throws Exception { @Test public void uploadIdPhotoTest() throws Exception { Assertions.assertEquals(idPhoto.getId() + ".png", idPhoto.getFileName()); + + Assertions.assertNotNull(idPhoto.toJson()); } @Test @@ -51,6 +53,8 @@ public void findIdPhotoTest() throws Exception { IdPhoto lookupIdPhoto = onfido.findIdPhoto(idPhoto.getId()); Assertions.assertEquals(idPhoto.getId() + ".png", lookupIdPhoto.getFileName()); + + Assertions.assertNotNull(idPhoto.toJson()); } @Test @@ -64,5 +68,8 @@ public void listIdPhotosTest() throws Exception { Assertions.assertEquals(idPhotos.get(0).getId() + ".png", idPhotos.get(0).getFileName()); Assertions.assertEquals(idPhotos.get(1).getId() + ".png", idPhotos.get(1).getFileName()); + + Assertions.assertNotNull(idPhotos.get(0).toJson()); + Assertions.assertNotNull(idPhotos.get(1).toJson()); } } diff --git a/src/test/java/com/onfido/integration/LivePhotoTest.java b/src/test/java/com/onfido/integration/LivePhotoTest.java index 39dfb85..1d22744 100644 --- a/src/test/java/com/onfido/integration/LivePhotoTest.java +++ b/src/test/java/com/onfido/integration/LivePhotoTest.java @@ -25,6 +25,8 @@ public void setupTest() throws Exception { @Test public void uploadLivePhotoTest() throws Exception { Assertions.assertEquals("sample_photo.png", livePhoto.getFileName()); + + Assertions.assertNotNull(livePhoto.toJson()); } @Test @@ -51,6 +53,8 @@ public void findLivePhotoTest() throws Exception { LivePhoto lookupLivePhoto = onfido.findLivePhoto(livePhoto.getId()); Assertions.assertEquals("sample_photo.png", lookupLivePhoto.getFileName()); + + Assertions.assertNotNull(lookupLivePhoto.toJson()); } @Test @@ -64,5 +68,8 @@ public void listLivePhotosTest() throws Exception { Assertions.assertEquals("another_sample_photo.png", livePhotos.get(0).getFileName()); Assertions.assertEquals("sample_photo.png", livePhotos.get(1).getFileName()); + + Assertions.assertNotNull(livePhotos.get(0).toJson()); + Assertions.assertNotNull(livePhotos.get(1).toJson()); } } diff --git a/src/test/java/com/onfido/integration/LiveVideoTest.java b/src/test/java/com/onfido/integration/LiveVideoTest.java index 11be97f..5c1bd43 100644 --- a/src/test/java/com/onfido/integration/LiveVideoTest.java +++ b/src/test/java/com/onfido/integration/LiveVideoTest.java @@ -52,6 +52,8 @@ public void findLiveVideoTest() throws Exception { LiveVideo liveVideo = onfido.findLiveVideo(sampleLiveVideoId1); Assertions.assertEquals("video.mov", liveVideo.getFileName()); + + Assertions.assertNotNull(liveVideo.toJson()); } @Test @@ -60,5 +62,8 @@ public void listLiveVideosTest() throws Exception { Assertions.assertEquals("video.mov", liveVideos.get(0).getFileName()); Assertions.assertEquals("video.mov", liveVideos.get(1).getFileName()); + + Assertions.assertNotNull(liveVideos.get(0).toJson()); + Assertions.assertNotNull(liveVideos.get(1).toJson()); } } diff --git a/src/test/java/com/onfido/integration/MotionCaptureTest.java b/src/test/java/com/onfido/integration/MotionCaptureTest.java index 14557c1..922fd30 100644 --- a/src/test/java/com/onfido/integration/MotionCaptureTest.java +++ b/src/test/java/com/onfido/integration/MotionCaptureTest.java @@ -57,6 +57,8 @@ public void findMotionCaptureTest() throws Exception { MotionCapture motionCapture = onfido.findMotionCapture(EXAMPLE_ID_1); Assertions.assertEquals(expectedFilename, motionCapture.getFileName()); + + Assertions.assertNotNull(motionCapture.toJson()); } @Test @@ -65,5 +67,8 @@ public void listMotionCapturesTest() throws Exception { onfido.listMotionCaptures(sampleApplicantId).getMotionCaptures(); Assertions.assertEquals(2, motionCaptures.size()); + + Assertions.assertNotNull(motionCaptures.get(0).toJson()); + Assertions.assertNotNull(motionCaptures.get(1).toJson()); } } diff --git a/src/test/java/com/onfido/integration/ReportSchemasTest.java b/src/test/java/com/onfido/integration/ReportSchemasTest.java index 68fadc2..36935d1 100644 --- a/src/test/java/com/onfido/integration/ReportSchemasTest.java +++ b/src/test/java/com/onfido/integration/ReportSchemasTest.java @@ -56,6 +56,10 @@ public void schemaOfDocumentReportIsValid() throws Exception { Assertions.assertNotNull(documentReport.getDocumentReport().getBreakdown()); Assertions.assertNotNull(documentReport.getDocumentReport().getProperties()); Assertions.assertNull(documentReport.getDocumentReport().getProperties().getDocumentSubtype()); + + Assertions.assertNotNull(documentReport.getDocumentReport().toJson()); + Assertions.assertNotNull(documentReport.getDocumentReport().getBreakdown().toJson()); + Assertions.assertNotNull(documentReport.getDocumentReport().getProperties().toJson()); } @Test @@ -89,5 +93,13 @@ public void schemaOfFacialSimilarityPhotoReportIsValid() throws Exception { facialSimilarityPhotoFullyAutoReport .getFacialSimilarityPhotoFullyAutoReport() .getProperties()); + + Assertions.assertNotNull( + facialSimilarityPhotoFullyAutoReport.getFacialSimilarityPhotoFullyAutoReport().toJson()); + Assertions.assertNotNull( + facialSimilarityPhotoFullyAutoReport + .getFacialSimilarityPhotoFullyAutoReport() + .getProperties() + .toJson()); } } diff --git a/src/test/java/com/onfido/integration/SdkTokenTest.java b/src/test/java/com/onfido/integration/SdkTokenTest.java index 8dfd361..86090ce 100644 --- a/src/test/java/com/onfido/integration/SdkTokenTest.java +++ b/src/test/java/com/onfido/integration/SdkTokenTest.java @@ -19,5 +19,7 @@ public void generateTokenTest() throws Exception { .referrer("https://*.example.com/example_page/*")); Assertions.assertTrue(token.getToken().length() > 0); + + Assertions.assertNotNull(token.toJson()); } } diff --git a/src/test/java/com/onfido/integration/TasksTest.java b/src/test/java/com/onfido/integration/TasksTest.java index 358f844..a554a63 100644 --- a/src/test/java/com/onfido/integration/TasksTest.java +++ b/src/test/java/com/onfido/integration/TasksTest.java @@ -29,6 +29,9 @@ public void listTasks() throws Exception { List tasks = onfido.listTasks(workflowRunId); Assertions.assertEquals(2, tasks.size()); + + Assertions.assertNotNull(tasks.get(0).toJson()); + Assertions.assertNotNull(tasks.get(1).toJson()); } @Test @@ -39,6 +42,8 @@ public void findTask() throws Exception { Assertions.assertEquals(lookupTask.getId(), task.getId()); Assertions.assertEquals(lookupTask.getTaskDefId(), task.getTaskDefId()); + + Assertions.assertNotNull(task.toJson()); } @Test diff --git a/src/test/java/com/onfido/integration/WebhookTest.java b/src/test/java/com/onfido/integration/WebhookTest.java index 9cd1e82..a17f460 100644 --- a/src/test/java/com/onfido/integration/WebhookTest.java +++ b/src/test/java/com/onfido/integration/WebhookTest.java @@ -36,6 +36,8 @@ private Webhook createWebhook(String url) throws Exception { @Test public void createWebhookTest() throws Exception { Assertions.assertEquals("https://example.com/webhook", webhook.getUrl()); + + Assertions.assertNotNull(webhook.toJson()); } @Test @@ -43,6 +45,8 @@ public void findWebhookTest() throws Exception { Webhook lookupWebhook = onfido.findWebhook(webhook.getId()); Assertions.assertEquals("https://example.com/webhook", lookupWebhook.getUrl()); + + Assertions.assertNotNull(lookupWebhook.toJson()); } @Test @@ -52,6 +56,8 @@ public void updateWebhookTest() throws Exception { webhook.getId(), new WebhookUpdater().url("https://example.com/webhook/updated")); Assertions.assertEquals("https://example.com/webhook/updated", updatedWebhook.getUrl()); + + Assertions.assertNotNull(updatedWebhook.toJson()); } @Test @@ -72,6 +78,9 @@ public void listWebhooksTest() throws Exception { Assertions.assertEquals(3, webhooks.size()); Assertions.assertEquals("https://example.com/firstWebhook", webhooks.get(0).getUrl()); Assertions.assertEquals("https://example.com/secondWebhook", webhooks.get(1).getUrl()); + + Assertions.assertNotNull(webhooks.get(0).toJson()); + Assertions.assertNotNull(webhooks.get(1).toJson()); } @Test diff --git a/src/test/java/com/onfido/integration/WorkflowRunTest.java b/src/test/java/com/onfido/integration/WorkflowRunTest.java index 93e510c..49f9637 100644 --- a/src/test/java/com/onfido/integration/WorkflowRunTest.java +++ b/src/test/java/com/onfido/integration/WorkflowRunTest.java @@ -30,6 +30,8 @@ public void setup() throws Exception { public void createWorkflowRunTest() throws Exception { Assertions.assertEquals(WORKFLOW_ID, workflowRun.getWorkflowId()); Assertions.assertEquals(applicantId, workflowRun.getApplicantId()); + + Assertions.assertNotNull(workflowRun.toJson()); } @Test @@ -50,6 +52,8 @@ public void createWorkflowRunWithCustomInputsTest() throws Exception { Assertions.assertEquals(applicantId, workflowRunWithCustomInputs.getApplicantId()); Assertions.assertEquals( WorkflowRun.StatusEnum.APPROVED, workflowRunWithCustomInputs.getStatus()); + + Assertions.assertNotNull(workflowRunWithCustomInputs.toJson()); } @Test @@ -58,6 +62,8 @@ public void findWorkflowRunTest() throws Exception { Assertions.assertEquals(WORKFLOW_ID, lookupWorkflowRun.getWorkflowId()); Assertions.assertEquals(applicantId, lookupWorkflowRun.getApplicantId()); + + Assertions.assertNotNull(lookupWorkflowRun.toJson()); } @Test @@ -78,6 +84,8 @@ public void generateTimelineFileTest() throws Exception { Assertions.assertNotNull(workflowTimelineFileData.getWorkflowTimelineFileId()); Assertions.assertNotNull(workflowTimelineFileData.getHref()); + + Assertions.assertNotNull(workflowTimelineFileData.toJson()); } @Test