use of net.petafuel.styx.api.v1.consent.entity.GetConsentStatusResponse in project styx by petafuel.
the class GetConsentResource method getConsentStatus.
/**
* Returns the consent status
*
* @param consentId of the target consent
* @return a GetConsentStatusResponse object
* @throws BankRequestFailedException if something went wrong between the core service and the aspsp
*/
@AcceptsPreStepAuth
@GET
@Path("/consents/{consentId}/status")
public Response getConsentStatus(@NotEmpty @NotBlank @PathParam("consentId") String consentId) throws BankRequestFailedException {
XS2AFactoryInput xs2AFactoryInput = new XS2AFactoryInput();
xs2AFactoryInput.setConsentId(consentId);
IOProcessor ioProcessor = new IOProcessor(getXS2AStandard());
ioProcessor.modifyInput(xs2AFactoryInput);
AISRequest request = new AISRequestFactory().create(getXS2AStandard().getRequestClassProvider().consentStatus(), xs2AFactoryInput);
request.getHeaders().putAll(getAdditionalHeaders());
ioProcessor.modifyRequest(request, xs2AFactoryInput);
ConsentStatus state = getXS2AStandard().getCs().getStatus(request);
GetConsentStatusResponse response = new GetConsentStatusResponse(state);
LOG.info("Successfully fetched consent status entity for bic={}, consentId={}", getXS2AStandard().getAspsp().getBic(), consentId);
return Response.status(ResponseConstant.OK).entity(response).build();
}
use of net.petafuel.styx.api.v1.consent.entity.GetConsentStatusResponse in project styx by petafuel.
the class ConsentResourcesFiduciaTest method C_getConsentStatusTest.
@Override
@Test
@Category(IntegrationTest.class)
public void C_getConsentStatusTest() throws IOException {
Response response = getConsentStatusEndpoint();
Assertions.assertEquals(200, response.getStatus());
GetConsentStatusResponse consentStatusResponse = jsonb.fromJson(IOUtils.toString((InputStream) response.getEntity(), StandardCharsets.UTF_8), GetConsentStatusResponse.class);
Assertions.assertEquals(ConsentStatus.RECEIVED, consentStatusResponse.getState());
}
use of net.petafuel.styx.api.v1.consent.entity.GetConsentStatusResponse in project styx by petafuel.
the class ConsentResourcesTargoTest method C_getConsentStatusTest.
@Override
@Test
@Category(IntegrationTest.class)
public void C_getConsentStatusTest() throws IOException {
Response response = getConsentStatusEndpoint();
Assertions.assertEquals(200, response.getStatus());
GetConsentStatusResponse consentStatusResponse = jsonb.fromJson(IOUtils.toString((InputStream) response.getEntity(), StandardCharsets.UTF_8), GetConsentStatusResponse.class);
Assertions.assertEquals(ConsentStatus.RECEIVED, consentStatusResponse.getState());
}
use of net.petafuel.styx.api.v1.consent.entity.GetConsentStatusResponse in project styx by petafuel.
the class ConsentResourcesConsorsTest method C_getConsentStatusTest.
@Override
@Test
@Category(IntegrationTest.class)
public void C_getConsentStatusTest() throws IOException {
Response response = getConsentStatusEndpoint();
Assertions.assertEquals(200, response.getStatus());
GetConsentStatusResponse consentStatusResponse = jsonb.fromJson(IOUtils.toString((InputStream) response.getEntity(), StandardCharsets.UTF_8), GetConsentStatusResponse.class);
Assertions.assertEquals(ConsentStatus.VALID, consentStatusResponse.getState());
}
use of net.petafuel.styx.api.v1.consent.entity.GetConsentStatusResponse in project styx by petafuel.
the class ConsentResourcesSparkasseTest method C_getConsentStatusTest.
@Override
@Test
@Category(IntegrationTest.class)
public void C_getConsentStatusTest() throws IOException {
Response response = getConsentStatusEndpoint();
Assertions.assertEquals(200, response.getStatus());
GetConsentStatusResponse consentStatusResponse = jsonb.fromJson(IOUtils.toString((InputStream) response.getEntity(), StandardCharsets.UTF_8), GetConsentStatusResponse.class);
Assertions.assertEquals(ConsentStatus.RECEIVED, consentStatusResponse.getState());
}
Aggregations