Skip to content

Commit

Permalink
Fixing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashi1993 committed Oct 22, 2024
1 parent a4f614e commit eab9599
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -448,14 +448,13 @@ public static JSONArray appendDummyAccountID() {

JSONArray accountsJSON = new JSONArray();
JSONObject accountOne = new JSONObject();
accountOne.put("account_id", "12345");
accountOne.put("account_id", "30080012343456");
accountOne.put("display_name", "Salary Saver Account");

accountsJSON.put(accountOne);

JSONObject accountTwo = new JSONObject();
accountTwo.put("account_id", "67890");
accountTwo.put("account_id", "67890");
accountTwo.put("account_id", "30080098763459");
accountTwo.put("display_name", "Max Bonus Account");

accountsJSON.put(accountTwo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,64 @@
@Path("/accountservice/")
public class AccountService {

@SuppressFBWarnings("JAXRS_ENDPOINT")
// Suppressed content - Endpoint
// Suppression reason - False Positive : This endpoint is a demo endpoint that is not exposed in production
// Suppressed warning count - 1
@GET
@Path("/accounts")
@Produces("application/json; charset=utf-8")
public Response getAccounts(@HeaderParam("x-fapi-interaction-id") String xFapiInteractionId,
@HeaderParam("Account-Request-Information") String accountRequestInfo) {

String finalRespose = "{\n" +
" \"Data\": {\n" +
" \"Account\": [\n" +
" {\n" +
" \"AccountId\": \"30080012343456\",\n" +
" \"Status\": \"Enabled\",\n" +
" \"StatusUpdateDateTime\": \"2020-04-16T06:06:06+00:00\",\n" +
" \"Currency\": \"GBP\",\n" +
" \"AccountType\": \"Personal\",\n" +
" \"AccountSubType\": \"CurrentAccount\",\n" +
" \"Nickname\": \"Bills\",\n" +
" \"OpeningDate\": \"2020-01-16T06:06:06+00:00\",\n" +
" \"MaturityDate\": \"2025-04-16T06:06:06+00:00\",\n" +
" \"Account\": [{\n" +
" \"SchemeName\": \"SortCodeAccountNumber\",\n" +
" \"Identification\": \"30080012343456\",\n" +
" \"Name\": \"Mr Kevin\",\n" +
" \"SecondaryIdentification\": \"00021\"\n" +
" }]\n" +
" },\n" +
" {\n" +
" \"AccountId\": \"30080098763459\",\n" +
" \"Status\": \"Enabled\",\n" +
" \"StatusUpdateDateTime\": \"2020-04-16T06:06:06+00:00\",\n" +
" \"Currency\": \"GBP\",\n" +
" \"AccountType\": \"Personal\",\n" +
" \"AccountSubType\": \"CurrentAccount\",\n" +
" \"Nickname\": \"Bills\",\n" +
" \"OpeningDate\": \"2020-01-16T06:06:06+00:00\",\n" +
" \"MaturityDate\": \"2025-04-16T06:06:06+00:00\"\n" +
" }\n" +
" ]\n" +
" },\n" +
" \"Links\": {\n" +
" \"Self\": \"https://api.alphabank.com/open-banking/v4.0/accounts\"\n" +
" },\n" +
" \"Meta\": {\n" +
" \"TotalPages\": 1\n" +
" }\n" +
"}";

if (xFapiInteractionId == null) {
xFapiInteractionId = UUID.randomUUID().toString();
}
return Response.status(200).entity(finalRespose)
.header("x-fapi-interaction-id", xFapiInteractionId).build();
}

@SuppressFBWarnings("JAXRS_ENDPOINT")
// Suppressed content - Endpoint
// Suppression reason - False Positive : This endpoint is a demo endpoint that is not exposed in production
Expand Down

0 comments on commit eab9599

Please sign in to comment.