Skip to content

Commit 86dfafc

Browse files
committed
Update pagination header
1 parent 9d8a5c8 commit 86dfafc

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/test/java/io/github/jpmorganchase/fusion/FusionTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ public void testListDatasetsWithPagination() throws Exception {
604604

605605
// Setup first page response with next token
606606
Map<String, java.util.List<String>> headers1 = new HashMap<>();
607-
headers1.put("x-next-token", java.util.Arrays.asList("token123"));
607+
headers1.put("x-jpmc-next-token", java.util.Arrays.asList("token123"));
608608

609609
io.github.jpmorganchase.fusion.http.HttpResponse<String> httpResponse1 =
610610
io.github.jpmorganchase.fusion.http.HttpResponse.<String>builder()
@@ -624,12 +624,12 @@ public void testListDatasetsWithPagination() throws Exception {
624624
// Mock the API calls
625625
when(apiManager.callAPIWithResponse(
626626
eq(String.format("%1scatalogs/%2s/datasets", config.getRootURL(), "common")),
627-
argThat(headers -> !headers.containsKey("x-next-token"))))
627+
argThat(headers -> !headers.containsKey("x-jpmc-next-token"))))
628628
.thenReturn(httpResponse1);
629629

630630
when(apiManager.callAPIWithResponse(
631631
eq(String.format("%1scatalogs/%2s/datasets", config.getRootURL(), "common")),
632-
argThat(headers -> "token123".equals(headers.get("x-next-token")))))
632+
argThat(headers -> "token123".equals(headers.get("x-jpmc-next-token")))))
633633
.thenReturn(httpResponse2);
634634

635635
// Setup expected aggregated response
@@ -656,7 +656,7 @@ public void testListProductsWithPagination() throws Exception {
656656

657657
// Setup first page response with next token
658658
Map<String, java.util.List<String>> headers1 = new HashMap<>();
659-
headers1.put("x-next-token", java.util.Arrays.asList("productToken"));
659+
headers1.put("x-jpmc-next-token", java.util.Arrays.asList("productToken"));
660660

661661
io.github.jpmorganchase.fusion.http.HttpResponse<String> httpResponse1 =
662662
io.github.jpmorganchase.fusion.http.HttpResponse.<String>builder()
@@ -675,12 +675,12 @@ public void testListProductsWithPagination() throws Exception {
675675

676676
when(apiManager.callAPIWithResponse(
677677
eq(String.format("%1scatalogs/%2s/products", config.getRootURL(), "common")),
678-
argThat(headers -> !headers.containsKey("x-next-token"))))
678+
argThat(headers -> !headers.containsKey("x-jpmc-next-token"))))
679679
.thenReturn(httpResponse1);
680680

681681
when(apiManager.callAPIWithResponse(
682682
eq(String.format("%1scatalogs/%2s/products", config.getRootURL(), "common")),
683-
argThat(headers -> "productToken".equals(headers.get("x-next-token")))))
683+
argThat(headers -> "productToken".equals(headers.get("x-jpmc-next-token")))))
684684
.thenReturn(httpResponse2);
685685

686686
Map<String, DataProduct> stubResponse = new HashMap<>();
@@ -705,7 +705,7 @@ public void testListAttributesWithPagination() throws Exception {
705705

706706
// Setup first page response with next token
707707
Map<String, java.util.List<String>> headers1 = new HashMap<>();
708-
headers1.put("x-next-token", java.util.Arrays.asList("attrToken"));
708+
headers1.put("x-jpmc-next-token", java.util.Arrays.asList("attrToken"));
709709

710710
io.github.jpmorganchase.fusion.http.HttpResponse<String> httpResponse1 =
711711
io.github.jpmorganchase.fusion.http.HttpResponse.<String>builder()
@@ -726,14 +726,14 @@ public void testListAttributesWithPagination() throws Exception {
726726
eq(String.format(
727727
"%1scatalogs/%2s/datasets/%3s/attributes",
728728
config.getRootURL(), "common", "sample_dataset")),
729-
argThat(headers -> !headers.containsKey("x-next-token"))))
729+
argThat(headers -> !headers.containsKey("x-jpmc-next-token"))))
730730
.thenReturn(httpResponse1);
731731

732732
when(apiManager.callAPIWithResponse(
733733
eq(String.format(
734734
"%1scatalogs/%2s/datasets/%3s/attributes",
735735
config.getRootURL(), "common", "sample_dataset")),
736-
argThat(headers -> "attrToken".equals(headers.get("x-next-token")))))
736+
argThat(headers -> "attrToken".equals(headers.get("x-jpmc-next-token")))))
737737
.thenReturn(httpResponse2);
738738

739739
Map<String, Attribute> stubResponse = new HashMap<>();

0 commit comments

Comments
 (0)