Skip to content

Commit 04d4ef9

Browse files
committed
PP-6076 Use UTF charset to parse CSV in integration tests
1 parent 03e39b5 commit 04d4ef9

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/test/java/uk/gov/pay/ledger/transaction/resource/TransactionResourceIT.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import static io.restassured.RestAssured.given;
3232
import static io.restassured.http.ContentType.JSON;
33+
import static java.nio.charset.StandardCharsets.UTF_8;
3334
import static java.time.ZoneOffset.UTC;
3435
import static org.apache.commons.csv.CSVFormat.DEFAULT;
3536
import static org.apache.commons.csv.CSVFormat.RFC4180;
@@ -717,7 +718,7 @@ public void shouldGetAllTransactionsAsCSVWithAcceptType() throws IOException {
717718
.contentType("text/csv")
718719
.extract().asInputStream();
719720

720-
List<CSVRecord> csvRecords = CSVParser.parse(csvResponseStream, Charset.defaultCharset(), RFC4180.withFirstRecordAsHeader()).getRecords();
721+
List<CSVRecord> csvRecords = CSVParser.parse(csvResponseStream, UTF_8, RFC4180.withFirstRecordAsHeader()).getRecords();
721722

722723
assertThat(csvRecords.size(), is(2));
723724

@@ -778,7 +779,7 @@ public void shouldGetAllTransactionsAsCSVWithAcceptTypeWithFeeHeaders() throws I
778779
.contentType("text/csv")
779780
.extract().asInputStream();
780781

781-
List<CSVRecord> csvRecords = CSVParser.parse(csvResponseStream, Charset.defaultCharset(), RFC4180.withFirstRecordAsHeader()).getRecords();
782+
List<CSVRecord> csvRecords = CSVParser.parse(csvResponseStream, UTF_8, RFC4180.withFirstRecordAsHeader()).getRecords();
782783

783784
assertThat(csvRecords.size(), is(1));
784785

@@ -811,7 +812,7 @@ public void shouldGetAllTransactionsAsCSVWithAcceptTypeWithMotoHeader() throws I
811812
.contentType("text/csv")
812813
.extract().asInputStream();
813814

814-
List<CSVRecord> csvRecords = CSVParser.parse(csvResponseStream, Charset.defaultCharset(), RFC4180.withFirstRecordAsHeader()).getRecords();
815+
List<CSVRecord> csvRecords = CSVParser.parse(csvResponseStream, UTF_8, RFC4180.withFirstRecordAsHeader()).getRecords();
815816

816817
assertThat(csvRecords.size(), is(1));
817818

@@ -877,7 +878,7 @@ public void shouldReturnCSVHeadersInCorrectOrder() throws IOException {
877878
.contentType("text/csv")
878879
.extract().asInputStream();
879880

880-
List<CSVRecord> csvRecords = CSVParser.parse(csvResponseStream, Charset.defaultCharset(), DEFAULT).getRecords();
881+
List<CSVRecord> csvRecords = CSVParser.parse(csvResponseStream, UTF_8, DEFAULT).getRecords();
881882

882883
CSVRecord header = csvRecords.get(0);
883884
assertThat(header.size(), is(25));

0 commit comments

Comments
 (0)