September 2019
Intermediate to advanced
462 pages
11h 3m
English
We have one unfinished piece of work in the Airport class—the fetchData() function is pending implementation. We need to replace the exception in that function with code to talk to the web service. Since it needs a network connection to talk to an external service, the test for fetchData() will be an integration test and not a unit test. We can’t get too specific about what to expect from the call, as details like delay will change frequently. Let’s write the integration test in a separate test class. Create a file named AirportIntegrationTest.kt in the directory src/test/kotlin/com/agiledeveloper/airportstatus and key in the following code:
Read now
Unlock full access