### Question:
ConsentServiceRemote implements ConsentServiceEncrypted { @Override public CmsResponse<Boolean> updateMultilevelScaRequired(String encryptedConsentId, boolean multilevelScaRequired) { try { Boolean updateResponse = consentRestTemplate.exchange(consentRemoteUrls.updateMultilevelScaRequired(), HttpMethod.PUT, null, Boolean.class, encryptedConsentId, multilevelScaRequired) .getBody(); return CmsResponse.<Boolean>builder() .payload(updateResponse) .build(); } catch (CmsRestException cmsRestException) { log.info("Couldn't update multilevel SCA required by consent ID {}, HTTP response status: {}", encryptedConsentId, 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 updateMultilevelScaRequired() { when(consentRemoteUrls.updateMultilevelScaRequired()).thenReturn(URL); when(consentRestTemplate.exchange(URL, HttpMethod.PUT, null, Boolean.class, CONSENT_ID, true)) .thenReturn(ResponseEntity.ok(true)); CmsResponse<Boolean> actualResponse = consentServiceRemote.updateMultilevelScaRequired(CONSENT_ID, true); assertTrue(actualResponse.isSuccessful()); assertTrue(actualResponse.getPayload()); }
@Test void updateMultilevelScaRequired_cmsRestException() { when(consentRemoteUrls.updateMultilevelScaRequired()).thenReturn(URL); when(consentRestTemplate.exchange(URL, HttpMethod.PUT, null, Boolean.class, CONSENT_ID, true)) .thenThrow(CmsRestException.class); CmsResponse<Boolean> actualResponse = consentServiceRemote.updateMultilevelScaRequired(CONSENT_ID, true); assertTrue(actualResponse.isSuccessful()); assertFalse(actualResponse.getPayload()); }