### Question:
ConsentIdHeaderCofValidatorImpl extends AbstractHeaderValidatorImpl implements FundsConfirmationHeaderValidator { @Override protected ValidationResult validate(Map<String, String> headers) { PiisConsentSupported piisConsentSupported = profileService.getPiisConsentSupported(); if (piisConsentSupported == PiisConsentSupported.TPP_CONSENT_SUPPORTED) { return checkIfHeaderIsPresented(headers); } return ValidationResult.valid(); } @Autowired  ConsentIdHeaderCofValidatorImpl(ErrorBuildingService errorBuildingService, AspspProfileServiceWrapper profileService);   }### Answer:
@Test void validate_absentHeaderError_tpp() { when(aspspProfileServiceWrapper.getPiisConsentSupported()) .thenReturn(PiisConsentSupported.TPP_CONSENT_SUPPORTED); validator.validate(headers, messageError); assertEquals(MessageErrorCode.FORMAT_ERROR_ABSENT_HEADER, messageError.getTppMessage().getMessageErrorCode()); assertArrayEquals(CONSENT_ID_HEADER_NAME, messageError.getTppMessage().getTextParameters()); }
@Test void validate_absentHeaderError_aspsp() { when(aspspProfileServiceWrapper.getPiisConsentSupported()) .thenReturn(PiisConsentSupported.ASPSP_CONSENT_SUPPORTED); validator.validate(headers, messageError); assertTrue(messageError.getTppMessages().isEmpty()); }