### Question:
AisConsentServiceRemote implements AisConsentServiceEncrypted { @Override public CmsResponse<CmsResponse.VoidResponse> checkConsentAndSaveActionLog(AisConsentActionRequest request) { try { consentRestTemplate.postForEntity(remoteAisConsentUrls.consentActionLog(), request, Void.class); } catch (CmsRestException cmsRestException) { log.info("Couldn't check consent and save action log, HTTP response status: {}", cmsRestException.getHttpStatus()); return CmsResponse.<CmsResponse.VoidResponse>builder() .error(cmsRestException.getCmsError()) .build(); } return CmsResponse.<CmsResponse.VoidResponse>builder() .payload(CmsResponse.voidResponse()) .build(); }  @Override CmsResponse<CmsResponse.VoidResponse> checkConsentAndSaveActionLog(AisConsentActionRequest request); @Override CmsResponse<CmsConsent> updateAspspAccountAccess(String consentId, AccountAccess request);  }### Answer:
@Test void checkConsentAndSaveActionLog() { when(aisConsentRemoteUrls.consentActionLog()).thenReturn(URL); AisConsentActionRequest aisConsentActionRequest = new AisConsentActionRequest(TPP_ID, CONSENT_ID, ActionStatus.SUCCESS, ACTION_LOG_REQUEST_URI, true, null, null); CmsResponse<CmsResponse.VoidResponse> response = aisConsentServiceRemote.checkConsentAndSaveActionLog(aisConsentActionRequest); assertTrue(response.isSuccessful()); verify(consentRestTemplate).postForEntity(URL, aisConsentActionRequest, Void.class); }
@Test void checkConsentAndSaveActionLog_cmsRestException() { when(aisConsentRemoteUrls.consentActionLog()).thenReturn(URL); AisConsentActionRequest aisConsentActionRequest = new AisConsentActionRequest(TPP_ID, CONSENT_ID, ActionStatus.SUCCESS, ACTION_LOG_REQUEST_URI, true, null, null); doThrow(CmsRestException.class).when(consentRestTemplate).postForEntity(URL, aisConsentActionRequest, Void.class); CmsResponse<CmsResponse.VoidResponse> response = aisConsentServiceRemote.checkConsentAndSaveActionLog(aisConsentActionRequest); assertTrue(response.hasError()); assertEquals(CmsError.TECHNICAL_ERROR, response.getError()); verify(consentRestTemplate).postForEntity(URL, aisConsentActionRequest, Void.class); }