### Question:
ConsentValidationService { public ValidationResult validateConsentOnCreate(CreateConsentReq request, PsuIdData psuIdData) { return createConsentRequestValidator.validate(new CreateConsentRequestObject(request, psuIdData)); }  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 validateConsentOnCreate() { ArgumentCaptor<CreateConsentRequestObject> createConsentRequestObjectCaptor = ArgumentCaptor.forClass(CreateConsentRequestObject.class); CreateConsentReq createConsentReq = new CreateConsentReq(); when(createConsentRequestValidator.validate(createConsentRequestObjectCaptor.capture())).thenReturn(ValidationResult.valid()); service.validateConsentOnCreate(createConsentReq, PSU_ID_DATA); verify(createConsentRequestValidator).validate(any(CreateConsentRequestObject.class)); assertEquals(createConsentReq, createConsentRequestObjectCaptor.getValue().getCreateConsentReq()); assertEquals(PSU_ID_DATA, createConsentRequestObjectCaptor.getValue().getPsuIdData()); }