Streamlining Game Initialization in Wordz

Learn to seamlessly connect to the domain layer, refactor initialization code for improved efficiency, and reinforce test suites for comprehensive coverage.

Connecting to the domain layer

Our next task is to receive an HTTP request and translate that into domain layer calls. This involves parsing JSON request data, using the Google Gson library, into Java objects, then sending that response data to the class Wordz port:

  • Add the code to call the domain layer port implemented as class Wordz. We will use Mockito to create a test double for this object. This allows us to test only the web endpoint code, decoupled from all other code:

Get hands-on with 1200+ tech skills courses.