### Question:
AisChecksumCalculatingServiceV3 implements ChecksumCalculatingService { @Override public boolean verifyConsentWithChecksum(Consent<?> consent, byte[] checksum) { if (consent == null || checksum == null) { return false; } if (ConsentType.AIS == consent.getConsentType()) { AisConsent aisConsent = (AisConsent) consent; return verifyConsentWithChecksumForAisConsent(aisConsent, checksum); } return false; }  @Override boolean verifyConsentWithChecksum(Consent<?> consent, byte[] checksum); @Override byte[] calculateChecksumForConsent(Consent<?> consent); @Override String getVersion();  }### Answer:
@Test void verifyConsentWithChecksum_success_tppAccesses() { AisConsent aisConsent = buildConsentTppIban(); boolean actualResult = aisChecksumCalculatingServiceV3.verifyConsentWithChecksum(aisConsent, CHECKSUM_TPP_ACCESS_IBAN); assertTrue(actualResult); }
@Test void verifyConsentWithChecksum_success_aspspAccesses() { AisConsent aisConsent = buildConsentAspspIban(); boolean actualResult = aisChecksumCalculatingServiceV3.verifyConsentWithChecksum(aisConsent, CHECKSUM_ASPSP_ACCESS_IBAN); assertTrue(actualResult); }
@Test void verifyConsentWithChecksum_wrongChecksum() { AisConsent aisConsent = buildConsentTppIban(); boolean actualResult = aisChecksumCalculatingServiceV3.verifyConsentWithChecksum(aisConsent, WRONG_CHECKSUM); assertFalse(actualResult); }
@Test void verifyConsentWithChecksum_wrongChecksumWithDelimiter() { AisConsent aisConsent = buildConsentTppIban(); boolean actualResult = aisChecksumCalculatingServiceV3.verifyConsentWithChecksum(aisConsent, WRONG_CHECKSUM_WITH_DELIMITER); assertFalse(actualResult); }
@Test void verifyConsentWithChecksum_wrongChecksumWithTwoParts() { AisConsent aisConsent = buildConsentTppIban(); boolean actualResult = aisChecksumCalculatingServiceV3.verifyConsentWithChecksum(aisConsent, WRONG_CHECKSUM_WITH_2_PARTS); assertFalse(actualResult); }
@Test void verifyConsentWithChecksum_success_tppAccesses_IbanAndMaskedPan() { AisConsent aisConsent = buildConsentTppIbanAndMaskedPan(); boolean actualResult = aisChecksumCalculatingServiceV3.verifyConsentWithChecksum(aisConsent, CHECKSUM_TPP_ACCESS_IBAN_MASKEDPAN); assertTrue(actualResult); }
@Test void verifyConsentWithChecksum_success_aspspAccesses_IbanAndMaskedPan() { AisConsent aisConsent = buildConsentAspspIbanAndMaskedPan(); boolean actualResult = aisChecksumCalculatingServiceV3.verifyConsentWithChecksum(aisConsent, CHECKSUM_ASPSP_ACCESS_IBAN_MASKEDPAN); assertTrue(actualResult); }
@Test void verifyConsentWithChecksum_consent_is_null() { boolean actualResult = aisChecksumCalculatingServiceV3.verifyConsentWithChecksum(null, CHECKSUM_ASPSP_ACCESS_IBAN); assertFalse(actualResult); }
@Test void verifyConsentWithChecksum_checksum_is_null() { AisConsent aisConsent = buildConsentAspspIbanAndMaskedPan(); boolean actualResult = aisChecksumCalculatingServiceV3.verifyConsentWithChecksum(aisConsent, null); assertFalse(actualResult); }
@Test void verifyConsentWithChecksum_consent_is_unknown_object() { boolean actualResult = aisChecksumCalculatingServiceV3.verifyConsentWithChecksum(new TestObject(), CHECKSUM_ASPSP_ACCESS_IBAN); assertFalse(actualResult); }