### Question:
AuthorisationModelMapper { @Mapping(target = "_links", ignore = true) @Mapping(target = "challengeData", ignore = true) @Mapping(target = "chosenScaMethod", ignore = true) @Mapping(target = "scaMethods", ignore = true) @Mapping(target = "links", expression = "java(hrefLinkMapper.mapToLinksMap(xs2aResponse.getLinks()))") public abstract StartScaprocessResponse mapToStartScaProcessResponseCancellation(Xs2aCreatePisCancellationAuthorisationResponse xs2aResponse);  Object mapToStartOrUpdateCancellationResponse(CancellationAuthorisationResponse cancellationAuthorisationResponse); @Mapping(target = "_links", ignore = true) @Mapping(target = "challengeData", ignore = true) @Mapping(target = "chosenScaMethod", ignore = true) @Mapping(target = "psuMessage", ignore = true) @Mapping(target = "scaMethods", ignore = true) @Mapping(target = "links", expression = "java(hrefLinkMapper.mapToLinksMap(xs2aResponse.getLinks()))") abstract StartScaprocessResponse mapToStartScaProcessResponse(Xs2aCreatePisAuthorisationResponse xs2aResponse); @Mapping(target = "_links", ignore = true) @Mapping(target = "challengeData", ignore = true) @Mapping(target = "chosenScaMethod", ignore = true) @Mapping(target = "scaMethods", ignore = true) @Mapping(target = "links", expression = "java(hrefLinkMapper.mapToLinksMap(xs2aResponse.getLinks()))") abstract StartScaprocessResponse mapToStartScaProcessResponse(CreateConsentAuthorizationResponse xs2aResponse); @Mapping(target = "_links", ignore = true) @Mapping(target = "challengeData", ignore = true) @Mapping(target = "chosenScaMethod", ignore = true) @Mapping(target = "scaMethods", ignore = true) @Mapping(target = "links", expression = "java(hrefLinkMapper.mapToLinksMap(xs2aResponse.getLinks()))") abstract StartScaprocessResponse mapToStartScaProcessResponseCancellation(Xs2aCreatePisCancellationAuthorisationResponse xs2aResponse); @Mapping(target = "_links", ignore = true) @Mapping(target = "links", expression = "java(hrefLinkMapper.mapToLinksMap(xs2aResponse.getLinks()))") @Mapping(target = "scaMethods", source = "availableScaMethods") abstract UpdatePsuAuthenticationResponse mapToUpdatePsuAuthenticationResponse(Xs2aUpdatePisCommonPaymentPsuDataResponse xs2aResponse);  }### Answer:
@Test void mapToStartScaProcessResponseCancellation_withPaymentResponse() { Xs2aCreatePisCancellationAuthorisationResponse objectFromFile = jsonReader.getObjectFromFile("json/web/mapper/Xs2aCreatePisCancellationAuthorisationResponse.json", Xs2aCreatePisCancellationAuthorisationResponse.class); StartScaprocessResponse expected = jsonReader.getObjectFromFile("json/web/mapper/StartScaprocessResponseCancellation.json", StartScaprocessResponse.class); StartScaprocessResponse actual = authorisationModelMapper.mapToStartScaProcessResponseCancellation(objectFromFile); assertEquals(expected, actual); verify(mockCoreObjectsMapper).mapToModelScaStatus(any(ScaStatus.class)); verify(mockHrefLinkMapper).mapToLinksMap(any(Links.class)); assertNotNull(actual.getAuthorisationId()); assertNotNull(actual.getScaStatus()); assertFalse(actual.getLinks().isEmpty()); }
@Test void mapToStartScaProcessResponseCancellation_withNullPaymentResponse_shouldReturnNull() { StartScaprocessResponse actual = authorisationModelMapper.mapToStartScaProcessResponseCancellation(null); assertNull(actual); }