package biz.nellemann.libcvrapi import spock.lang.Specification class CvrApiSpec extends Specification { CvrApi api File testFile String testJson def setup() { api = new CvrApi("Test User Agent", "testAuthToken") testFile = new File(getClass().getResource('/company.json').toURI()) testJson = testFile.getText('UTF-8') } def cleanup() { } void "test we can parse a company"() { when: def company = api.parseJsonIntoCompany(testJson) then: company != null company.vat == 25063864 company.life.name == 'AGILLIC A/S' company.secondarynames.contains('Wavetech A/S') company.info.employment.amountEmployeesLow == 50 company.info.employment.amountEmployeesHigh == 99 } }