This commit is contained in:
parent
f45b299444
commit
91e04b06f7
|
@ -59,6 +59,22 @@ class OpenCvrApiSpec extends Specification {
|
|||
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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue