### Question:
ConsentValidationService { public ValidationResult validateConsentPsuDataOnUpdate(AisConsent consent, UpdateConsentPsuDataReq request) { return updateConsentPsuDataValidator.validate(new UpdateConsentPsuDataRequestObject(consent, request)); }  ValidationResult validateConsentOnCreate(CreateConsentReq request, PsuIdData psuIdData); ValidationResult validateConsentOnGettingStatusById(AisConsent consent); ValidationResult validateConsentOnDelete(AisConsent consent); ValidationResult validateConsentOnGettingById(AisConsent consent); ValidationResult validateConsentAuthorisationOnCreate(CreateConsentAuthorisationObject createConsentAuthorisationObject); ValidationResult validateConsentPsuDataOnUpdate(AisConsent consent, UpdateConsentPsuDataReq request); ValidationResult validateConsentAuthorisationOnGettingById(AisConsent consent); ValidationResult validateConsentAuthorisationScaStatus(AisConsent consent, String authorisationId); Set<TppMessageInformation> buildWarningMessages(CreateConsentReq request);  }### Answer:
@Test void validateConsentPsuDataOnUpdate() { ArgumentCaptor<UpdateConsentPsuDataRequestObject> updateConsentPsuDataRequestObjectCaptor = ArgumentCaptor.forClass(UpdateConsentPsuDataRequestObject.class); UpdateConsentPsuDataReq request = new UpdateConsentPsuDataReq(); when(updateConsentPsuDataValidator.validate(updateConsentPsuDataRequestObjectCaptor.capture())).thenReturn(ValidationResult.valid()); service.validateConsentPsuDataOnUpdate(aisConsent, request); verify(updateConsentPsuDataValidator).validate(any(UpdateConsentPsuDataRequestObject.class)); assertEquals(aisConsent, updateConsentPsuDataRequestObjectCaptor.getValue().getAisConsent()); assertEquals(request, updateConsentPsuDataRequestObjectCaptor.getValue().getUpdateRequest()); }