### Question:
ConsentServiceRemote implements ConsentServiceEncrypted { @Override public CmsResponse<Boolean> updateConsentStatusById(String consentId, ConsentStatus status) { try { consentRestTemplate.put(consentRemoteUrls.updateConsentStatusById(), null, consentId, status); return CmsResponse.<Boolean>builder() .payload(true) .build(); } catch (CmsRestException cmsRestException) { log.info("Couldn't update consent status by consent ID {}, HTTP response status: {}", consentId, cmsRestException.getHttpStatus()); } return CmsResponse.<Boolean>builder() .payload(false) .build(); }  @Override CmsResponse<CmsCreateConsentResponse> createConsent(CmsConsent cmsConsent); @Override CmsResponse<ConsentStatus> getConsentStatusById(String consentId); @Override CmsResponse<Boolean> updateConsentStatusById(String consentId, ConsentStatus status); @Override CmsResponse<CmsConsent> getConsentById(String consentId); @Override CmsResponse<Boolean> findAndTerminateOldConsentsByNewConsentId(String newConsentId); @Override CmsResponse<List<PsuIdData>> getPsuDataByConsentId(String consentId); @Override CmsResponse<Boolean> updateMultilevelScaRequired(String encryptedConsentId, boolean multilevelScaRequired);  }### Answer:
@Test void updateConsentStatusById() { when(consentRemoteUrls.updateConsentStatusById()).thenReturn(URL); ConsentStatus newConsentStatus = ConsentStatus.RECEIVED; CmsResponse<Boolean> actualResponse = consentServiceRemote.updateConsentStatusById(CONSENT_ID, newConsentStatus); assertTrue(actualResponse.isSuccessful()); assertTrue(actualResponse.getPayload()); verify(consentRestTemplate).put(URL, null, CONSENT_ID, newConsentStatus); }
@Test void updateConsentStatusById_cmsRestException() { when(consentRemoteUrls.updateConsentStatusById()).thenReturn(URL); ConsentStatus newConsentStatus = ConsentStatus.RECEIVED; doThrow(CmsRestException.class).when(consentRestTemplate).put(URL, null, CONSENT_ID, newConsentStatus); CmsResponse<Boolean> actualResponse = consentServiceRemote.updateConsentStatusById(CONSENT_ID, newConsentStatus); assertTrue(actualResponse.isSuccessful()); assertFalse(actualResponse.getPayload()); verify(consentRestTemplate).put(URL, null, CONSENT_ID, newConsentStatus); }