Provide us with confidence that the 3 services we are implementing are working. So create at a minimum of 3, but you might want to put in alot more. Three are for the happy path where nothing goes wrong, but we also need to check error handling.
Testing from end user’s perspective whether the REST Service/API is working as expected.
- Design and implement you REST Service
- Create tests that programatically exercise the API
- For each test
- Save the response
- Write assertions
At times functional and integration testing is very similar for an API.
Unit Testing vs Functional testing
- Unit testing is concerned with testing individual layers of your appliation
- Functional testing is converned with testing whether the entire application is working as expected or not
- Unit testing involved mocking out the dependencies of the code under test
- Functional tests typically do not involve mocking.
You are just concerned that the application works to the outside world, while unit testing checks whether the individual elements behave as they should.
Changing application’s internal architecture should not affect functional tests if they are written properly.
Unit tests are supposed to get affected by changes to application’s architecture
SoupUI -> http://www.soupui.com/
Spock -> Looked pretty good https://code.google.com/p/spock/
We are going to use straight Java… so let’s look at an example!
@XmlAttribute import javax.xml.bind.annotation.XmlAttribute example code for E10.
- Database interaction
- JDBC -> Java Database Connector
- O/RM -> Object Relationship Mapper
- Intro to Cloud Computing