### Question:
StationMessageRouter { public void route(StationMessage stationMessage) { messageHandlers.get(stationMessage.getType()).handle(stationMessage.getData()); } StationMessageRouter(ServerMessageHandler serverMessageHandler, UserMessageHandler userMessageHandler, SystemMessageHandler systemMessageHandler); void route(StationMessage stationMessage);  }### Answer:
@Test void verifyServerMessageRouting() { String messageBody = "dummy-body"; StationMessage stationMessage = new StationMessage(STATION_ID, StationMessage.Type.OCPP_MESSAGE, messageBody); stationMessageRouter.route(stationMessage); verify(serverMessageHandlerMock).handle(serverMessageCaptor.capture()); assertThat(messageBody).isEqualTo(serverMessageCaptor.getValue()); }
@Test void verifyUserMessageRouting() { UserMessage userMessage = new Authorize(DEFAULT_TOKEN_ID, DEFAULT_EVSE_ID); StationMessage stationMessage = new StationMessage(STATION_ID, StationMessage.Type.USER_ACTION, userMessage); stationMessageRouter.route(stationMessage); verify(userMessageHandlerMock).handle(userMessageCaptor.capture()); assertThat(userMessage).isEqualTo(userMessageCaptor.getValue()); }
@Test void verifySystemMessageRouting() { SystemMessage systemMessage = new CancelRemoteStartTransaction(DEFAULT_EVSE_ID, DEFAULT_CONNECTOR_ID); StationMessage stationMessage = new StationMessage(STATION_ID, StationMessage.Type.SYSTEM_ACTION, systemMessage); stationMessageRouter.route(stationMessage); verify(systemMessageHandlerMock).handle(systemMessageCaptor.capture()); assertThat(systemMessage).isEqualTo(systemMessageCaptor.getValue()); }