### Question:
AccountAspectService extends BaseAspectService<AccountController> { public ResponseObject<Xs2aAccountDetailsHolder> getAccountDetailsAspect(ResponseObject<Xs2aAccountDetailsHolder> result) { if (!result.hasError()) { Xs2aAccountDetailsHolder body = result.getBody(); Xs2aAccountDetails accountDetails = body.getAccountDetails(); accountDetails.setLinks(new AccountDetailsLinks(getHttpUrl(), accountDetails.getResourceId(), body.getAisConsent())); } return result; } @Autowired  AccountAspectService(AspspProfileServiceWrapper aspspProfileServiceWrapper); ResponseObject<Xs2aAccountDetailsHolder> getAccountDetailsAspect(ResponseObject<Xs2aAccountDetailsHolder> result); ResponseObject<Xs2aAccountListHolder> getAccountDetailsListAspect(ResponseObject<Xs2aAccountListHolder> result);  }### Answer:
@Test void getAccountDetailsAspect_success() { AspspSettings aspspSettings = jsonReader.getObjectFromFile("json/aspect/aspsp-settings.json", AspspSettings.class); when(aspspProfileServiceWrapper.isForceXs2aBaseLinksUrl()) .thenReturn(aspspSettings.getCommon().isForceXs2aBaseLinksUrl()); when(aspspProfileServiceWrapper.getXs2aBaseLinksUrl()) .thenReturn(aspspSettings.getCommon().getXs2aBaseLinksUrl()); responseObject = ResponseObject.<Xs2aAccountDetailsHolder>builder() .body(new Xs2aAccountDetailsHolder(accountDetails, aisConsent)) .build(); ResponseObject actualResponse = service.getAccountDetailsAspect(responseObject); assertNotNull(accountDetails.getLinks()); assertTrue(accountDetails.getLinks() instanceof AccountDetailsLinks); assertFalse(actualResponse.hasError()); }
@Test void getAccountDetailsAspect_withError_shouldAddTextErrorMessage() { responseObject = ResponseObject.<Xs2aCreatePisCancellationAuthorisationResponse>builder() .fail(AIS_400, of(CONSENT_UNKNOWN_400)) .build(); ResponseObject actualResponse = service.getAccountDetailsAspect(responseObject); assertTrue(actualResponse.hasError()); }