diff --git a/src/test/kotlin/com/veryfi/kotlin/ClientTest.kt b/src/test/kotlin/com/veryfi/kotlin/ClientTest.kt index 75954a8..0859073 100644 --- a/src/test/kotlin/com/veryfi/kotlin/ClientTest.kt +++ b/src/test/kotlin/com/veryfi/kotlin/ClientTest.kt @@ -91,7 +91,8 @@ class ClientTest { `when`(httpResponse.statusCode()).thenReturn(200) `when`(httpResponse.body()).thenReturn(result) } - val jsonResponse = client.processDocument("receipt.jpg", categories, false, null) + val path = ClassLoader.getSystemResource("receipt.jpg").path + val jsonResponse = client.processDocument(path, categories, false, null) val document = JSONObject(jsonResponse) Assertions.assertEquals("Walgreens", document.getJSONObject("vendor").getString("name")) } @@ -111,7 +112,8 @@ class ClientTest { `when`(httpResponse.statusCode()).thenReturn(200) `when`(httpResponse.body()).thenReturn(result) } - val jsonResponse = client.processDocument("receipt.jpg", categories, false, parameters) + val path = ClassLoader.getSystemResource("receipt.jpg").path + val jsonResponse = client.processDocument(path, categories, false, parameters) val document = JSONObject(jsonResponse) Assertions.assertEquals("Walgreens", document.getJSONObject("vendor").getString("name")) } @@ -129,7 +131,9 @@ class ClientTest { `when`(httpResponse.statusCode()).thenReturn(200) `when`(httpResponse.body()).thenReturn(result) } - val jsonResponse = client.processDocument("receipt.jpg", null, false, null) + + val path = ClassLoader.getSystemResource("receipt.jpg").path + val jsonResponse = client.processDocument(path, null, false, null) val document = JSONObject(jsonResponse) Assertions.assertEquals("Walgreens", document.getJSONObject("vendor").getString("name")) } @@ -198,7 +202,7 @@ class ClientTest { null ) val document = JSONObject(jsonResponse) - Assertions.assertEquals("Rumpke", document.getJSONObject("vendor").getString("name")) + Assertions.assertEquals("Rumpke Of Ohio", document.getJSONObject("vendor").getString("name")) } @Test @@ -226,7 +230,7 @@ class ClientTest { parameters ) val document = JSONObject(jsonResponse) - Assertions.assertEquals("Rumpke", document.getJSONObject("vendor").getString("name")) + Assertions.assertEquals("Rumpke Of Ohio", document.getJSONObject("vendor").getString("name")) } @Test @@ -291,7 +295,8 @@ class ClientTest { `when`(httpResponse.statusCode()).thenReturn(200) `when`(httpResponse.body()).thenReturn(result) } - val jsonResponseFuture = client.processDocumentAsync("receipt.jpg", categories, false, null) + val path = ClassLoader.getSystemResource("receipt.jpg").path + val jsonResponseFuture = client.processDocumentAsync(path, categories, false, null) val jsonResponse = jsonResponseFuture.get() val document = JSONObject(jsonResponse) Assertions.assertEquals("Walgreens", document.getJSONObject("vendor").getString("name")) @@ -372,7 +377,7 @@ class ClientTest { ) val jsonResponse = jsonResponseFuture.get() val document = JSONObject(jsonResponse) - Assertions.assertEquals("Rumpke", document.getJSONObject("vendor").getString("name")) + Assertions.assertEquals("Rumpke Of Ohio", document.getJSONObject("vendor").getString("name")) } @Test diff --git a/src/test/resources/processDocumentUrl.json b/src/test/resources/processDocumentUrl.json index 7c45d15..05a8f27 100644 --- a/src/test/resources/processDocumentUrl.json +++ b/src/test/resources/processDocumentUrl.json @@ -166,7 +166,7 @@ "vendor":{ "address":"3800 Struble Rd, Cincinnati, OH 45251, United States", "fax_number":"", - "name":"Rumpke", + "name":"Rumpke Of Ohio", "phone_number":"(800) 828-8171", "raw_name":"RUMPKE", "vendor_logo":"https://cdn.veryfi.com/logos/tmp/346683478.png",