From 06b269b439d660319cdb9aea84e4fed2c5a247b0 Mon Sep 17 00:00:00 2001 From: Shelby Holden Date: Mon, 4 Mar 2024 14:27:18 -0500 Subject: [PATCH] DC-839: Move references back to datarepo-client; Upgrade to latest (#175) https://broadworkbench.atlassian.net/browse/DC-839 _______ With the https://github.com/DataBiosphere/jade-data-repo/pull/1581 for data repo, we're switching back to only publishing to one Jakarta backed client. This PR moves your references to the jakarta client back to the main data repo client and bumps to the latest version. This is an effort to alleviate any confusion around upgrading past the last supported datarepo-jakarta-client version. --- .../groovy/bio.terra.catalog.java-common-conventions.gradle | 2 +- .../java/bio/terra/catalog/datarepo/DatarepoService.java | 2 +- .../bio/terra/catalog/datarepo/DatarepoServiceTest.java | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/groovy/bio.terra.catalog.java-common-conventions.gradle b/buildSrc/src/main/groovy/bio.terra.catalog.java-common-conventions.gradle index 9669a028..e18ec6bc 100644 --- a/buildSrc/src/main/groovy/bio.terra.catalog.java-common-conventions.gradle +++ b/buildSrc/src/main/groovy/bio.terra.catalog.java-common-conventions.gradle @@ -50,7 +50,7 @@ dependencies { implementation 'bio.terra:terra-common-lib:0.1.9-SNAPSHOT' // guava is depended on by terra-common-lib, https://broadworkbench.atlassian.net/browse/DC-798 implementation 'com.google.guava:guava:31.1-jre' - implementation 'bio.terra:datarepo-jakarta-client:1.563.0-SNAPSHOT' + implementation 'bio.terra:datarepo-client:2.13.0-SNAPSHOT' } tasks.named('test') { diff --git a/common/src/main/java/bio/terra/catalog/datarepo/DatarepoService.java b/common/src/main/java/bio/terra/catalog/datarepo/DatarepoService.java index 9904ebf9..17a0786c 100644 --- a/common/src/main/java/bio/terra/catalog/datarepo/DatarepoService.java +++ b/common/src/main/java/bio/terra/catalog/datarepo/DatarepoService.java @@ -72,7 +72,7 @@ public Map getDatasets() { EnumerateSnapshotModel response = datarepoClient .snapshotsApi() - .enumerateSnapshots(null, MAX_DATASETS, null, null, null, null, null, null); + .enumerateSnapshots(null, MAX_DATASETS, null, null, null, null, null, null, null); Map> roleMap = response.getRoleMap(); return response.getItems().stream() diff --git a/common/src/test/java/bio/terra/catalog/datarepo/DatarepoServiceTest.java b/common/src/test/java/bio/terra/catalog/datarepo/DatarepoServiceTest.java index a6b59342..9e67e2df 100644 --- a/common/src/test/java/bio/terra/catalog/datarepo/DatarepoServiceTest.java +++ b/common/src/test/java/bio/terra/catalog/datarepo/DatarepoServiceTest.java @@ -73,7 +73,8 @@ void getSnapshots() throws Exception { new EnumerateSnapshotModel() .items(List.of(new SnapshotSummaryModel().id(snapshotId).phsId("1234"))) .roleMap(items); - when(snapshotsApi.enumerateSnapshots(any(), any(), any(), any(), any(), any(), any(), any())) + when(snapshotsApi.enumerateSnapshots( + any(), any(), any(), any(), any(), any(), any(), any(), any())) .thenReturn(esm); var returnedItems = datarepoService.getDatasets(); assertThat(returnedItems, is(expectedItems)); @@ -99,7 +100,8 @@ void getSnapshot() throws Exception { @Test void getSnapshotsException() throws Exception { mockSnapshots(); - when(snapshotsApi.enumerateSnapshots(any(), any(), any(), any(), any(), any(), any(), any())) + when(snapshotsApi.enumerateSnapshots( + any(), any(), any(), any(), any(), any(), any(), any(), any())) .thenThrow(new ApiException()); assertThrows(DatarepoException.class, () -> datarepoService.getDatasets()); }