add test
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Mark Nellemann 2023-02-19 15:24:05 +01:00
parent f45b299444
commit 91e04b06f7

View file

@ -59,6 +59,22 @@ class OpenCvrApiSpec extends Specification {
company.name == 'Mintr ApS' company.name == 'Mintr ApS'
} }
void "test we can HTTP GET company with CVR 25063864 deserialized into Company"() {
setup:
def testFile = new File(getClass().getResource('/open-38979167.json').toURI())
def testJson = testFile.getText('UTF-8')
mockServer.enqueue(new MockResponse().setBody(testJson));
HttpUrl baseUrl = mockServer.url("/api");
api = new OpenCvrApi("Test User Agent", baseUrl.toString())
when:
def company = api.getCompanyByVatNumber("25063864")
then:
company != null
company.vat == 38979167
}
} }