Skip to content

Commit

Permalink
PP-12107: Fix failing test (#1212)
Browse files Browse the repository at this point in the history
shouldReturnInformationFromBuiltInDefaultBinRangeFiles was failing because in a
build on the CI pipeline, real CSVs from Worldpay are copied to the
src/main/resources/data-sources folder. Thus the card number 1234567890000000
will fail to be found. To get around this, use a well known test card number
4000056655665556 that is also publicly available in
https://docs.stripe.com/testing?locale=en-GB and in the CSV from Worldpay.

This commit also removes "-DskipTests" from the ARM Dockerfile.
  • Loading branch information
oswaldquek committed May 13, 2024
1 parent 8a17646 commit 1c3dd5b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion m1/arm64.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM maven:3.9.5-eclipse-temurin-11@sha256:d698c543af44a1a8e4b2b2f9c1cfe3e009f23
WORKDIR /home/build
COPY . .

RUN ["mvn", "clean", "--no-transfer-progress", "package", "-DskipTests"]
RUN ["mvn", "clean", "--no-transfer-progress", "package"]

FROM eclipse-temurin:11-jre@sha256:b074dd1f14c752c818fd2bf118db451b19b207700e52383bdf7a31412c876a90 AS final

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/data-sources/test-cards.csv
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
02,67999901000,67999901000,D,MAESTRO,NOT_PREPAID,NOT_CORPORATE
02,71221111000,71221400000,CD,DISCOVER,PREPAID,CORPORATE
02,37144963500,37144963500,C,AMEX,NOT_PREPAID,NOT_CORPORATE

02,40000566556,40000566556,D,VISA DEBIT,NOT_PREPAID,NOT_CORPORATE
09
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ public void shouldReturn422WhenCardNumberIsTooBig() {

@Test
public void shouldReturnInformationFromBuiltInDefaultBinRangeFiles() {
getCardInformation("1234567890000000", appUsingDefaultFiles)
getCardInformation("4000056655665556", appUsingDefaultFiles)
.statusCode(200)
.contentType(JSON)
.body("brand", is("it test example"))
.body("label", is("IT Test Example"))
.body("brand", is("visa"))
.body("label", is("VISA DEBIT"))
.body("type", is("D"))
.body("prepaid", is("NOT_PREPAID"))
.body("corporate", is(false));
Expand Down

0 comments on commit 1c3dd5b

Please sign in to comment.