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, and then sending that response data to the class Wordz port.

  • We add the code to call the domain layer port implemented as the Wordz class. We’ll 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 1400+ tech skills courses.