### Question:
CmsConsentAuthorisationServiceInternal { public boolean updateScaStatusAndAuthenticationData(@NotNull ScaStatus status, AuthorisationEntity authorisation, AuthenticationDataHolder authenticationDataHolder) { if (authorisation.getScaStatus().isFinalisedStatus()) { log.info("Authorisation ID [{}], SCA status [{}]. Update authorisation status failed in updateScaStatusAndAuthenticationData method because authorisation has finalised status.", authorisation.getExternalId(), authorisation.getScaStatus().getValue()); return false; } authorisation.setScaStatus(status); if (authenticationDataHolder != null) { enrichAuthorisationWithAuthenticationData(authorisation, authenticationDataHolder); } return true; }  Optional<AuthorisationEntity> getAuthorisationByAuthorisationId(@NotNull String authorisationId, @NotNull String instanceId); Optional<AuthorisationEntity> getAuthorisationByRedirectId(String redirectId, String instanceId); boolean updateScaStatusAndAuthenticationData(@NotNull ScaStatus status, AuthorisationEntity authorisation, AuthenticationDataHolder authenticationDataHolder); List<AuthorisationEntity> getAuthorisationsByParentExternalId(String externalId);  }### Answer:
@Test void updateScaStatusAndAuthenticationData_success() { authorisationEntity.setScaStatus(ScaStatus.PSUAUTHENTICATED); authorisationEntity.setScaAuthenticationData("none"); authorisationEntity.setAuthenticationMethodId("none"); boolean actual = cmsConsentAuthorisationServiceInternal.updateScaStatusAndAuthenticationData(ScaStatus.RECEIVED, authorisationEntity, authenticationDataHolder); assertTrue(actual); assertEquals(authenticationDataHolder.getAuthenticationData(), authorisationEntity.getScaAuthenticationData()); assertEquals(authenticationDataHolder.getAuthenticationMethodId(), authorisationEntity.getAuthenticationMethodId()); assertEquals(ScaStatus.RECEIVED, authorisationEntity.getScaStatus()); }
@Test void updateScaStatusAndAuthenticationData_statusFinalised() { authorisationEntity.setScaStatus(ScaStatus.FAILED); boolean actual = cmsConsentAuthorisationServiceInternal.updateScaStatusAndAuthenticationData(ScaStatus.RECEIVED, authorisationEntity, authenticationDataHolder); assertFalse(actual); }