Chapter 4. Component-testing microservices
This chapter covers
- Introducing the Arquillian testing framework
- Working with Arquillian extensions for RESTful web services and Spring
- Testing resource, domain, and remote components
You’ve learned about the basic component makeup of a microservice and various basic testing techniques. Now it’s time to dig a little deeper into what style of test best suits each component, and how you should implement those tests.
Component tests should be designed to verify the functionality of and between a microservice’s internal modules, with one exception: the external public-facing resource component. You want to be sure the public-facing service is accessible to the world in the way that you’ve planned, so you’ll need to define a client-based test that ensures this is the case. A component test shouldn’t cross a remote boundary outside the local machine.