mojaloop / project

Repo to track product development issues for the Mojaloop project.
Other
23 stars 15 forks source link

TTK: Inaccurate Mock Responses and Additional Random Fields Introduced After Node.js Upgrade (Version 16.1.2) #3595

Open vijayg10 opened 10 months ago

vijayg10 commented 10 months ago

Summary: Users of the testing toolkit are encountering inaccuracies in the mock responses generated by the application. These inaccuracies include additional random fields appearing in the responses, causing discrepancies in the expected output. This issue was introduced in version v16.1.2 of the toolkit, which involved an upgrade to Node.js.

Acceptance Criteria

Request Sent:

{
  "quoteId": "b51ec534-ee48-4575-b6a9-ead2955b8069",
  "transactionId": "a8323bc6-c228-4df2-ae82-e5a997baf899",
  "transactionRequestId": "a8323bc6-c228-4df2-ae82-e5a997baf890",
  "payee": {
    "partyIdInfo": {
      "partyIdType": "PERSONAL_ID",
      "partyIdentifier": "16135551212",
      "fspId": "1234"
    },
    "merchantClassificationCode": "4321",
    "name": "Henrik Karlsson",
    "personalInfo": {
      "complexName": {
        "firstName": "Henrik",
        "middleName": "Johannes",
        "lastName": "Karlsson"
      },
      "dateOfBirth": "1966-06-16"
    }
  },
  "payer": {
    "partyIdInfo": {
      "partyIdType": "PERSONAL_ID",
      "partyIdentifier": "16135551212",
      "fspId": "1234"
    },
    "merchantClassificationCode": "4321",
    "name": "Henrik Karlsson",
    "personalInfo": {
      "complexName": {
        "firstName": "Henrik",
        "middleName": "Johannes",
        "lastName": "Karlsson"
      },
      "dateOfBirth": "1966-06-16"
    }
  },
  "amountType": "SEND",
  "amount": {
    "currency": "USD",
    "amount": "123.45"
  },
  "fees": {
    "currency": "USD",
    "amount": "123.45"
  },
  "transactionType": {
    "scenario": "DEPOSIT",
    "initiator": "PAYEE",
    "initiatorType": "CONSUMER"
  },
  "note": "Free-text memo.",
  "expiration": "2016-05-24T08:38:08.699-04:00"
}

Callback Generated:

{
  "url": "put /quotes/b51ec534-ee48-4575-b6a9-ead2955b8069",
  "headers": {
    "content-type": "application/vnd.interoperability.quotes+json;version=1.1",
    "date": "Tue, 24 Oct 2023 09:06:11 GMT",
    "x-forwarded-for": "id reprehenderit",
    "fspiop-source": "1234",
    "fspiop-destination": "ttktest",
    "fspiop-encryption": "officia proident",
    "fspiop-signature": "elit quis",
    "fspiop-uri": "ut consectetur in",
    "fspiop-http-method": "aliqua",
    "traceparent": "00-aabb30ec007ce0a65e192890c752c3d6-0123456789abcdef0-00",
    "user-agent": "axios/1.5.1",
    "content-length": "2240",
    "accept-encoding": "gzip, compress, deflate, br",
    "host": "localhost:4040",
    "connection": "keep-alive"
  },
  "body": {
    "transferAmount": {
      "laboris2c4": 69060210.48940009,
      "currency": "USD",
      "amount": "123.45"
    },
    "payeeReceiveAmount": {
      "ea_2c": -33789620.88528228,
      "sint2": false,
      "currency": "USD",
      "amount": "123.45"
    },
    "payeeFspFee": {
      "quisc2": "incididunt",
      "currency": "USD",
      "amount": "0.2"
    },
    "payeeFspCommission": {
      "sint933": -69490529.02153715,
      "reprehenderit_4d": false,
      "voluptate5e": "commodo reprehenderit",
      "sint_5": false,
      "consectetur_c": -53266662.7220562,
      "doab": false,
      "qui_f2": true,
      "currency": "USD",
      "amount": "0.3"
    },
    "expiration": "2023-10-25T09:06:12.015Z",
    "geoCode": {
      "officia_7": -57336435.384866565,
      "latitude": "76",
      "longitude": "180"
    },
    "ilpPacket": "<Removed>",
    "condition": "<Removed>"
  }
}

Severity: (Low, Medium, High)

Priority: (Critical, Medium, Low)

Expected Behavior The testing toolkit should generate mock responses accurately, following the openAPI definition. Users should be able to rely on the generated responses for testing purposes.

Steps to Reproduce

  1. Use the testing toolkit version 16.1.2.
  2. Send a sample request to TTK (For example: POST /quotes)
  3. Observe the generated callback. It contains random fields in the body.

Specifications

PaulGregoryBaker commented 10 months ago

Hey team! Please add your planning poker estimate with Zenhub @aaronreynoza @kleyow @oderayi @sri-miriyala @vijayg10