From c8a804f07204cc0d4cdc3839eb6de43a2453286f Mon Sep 17 00:00:00 2001 From: mherran Date: Fri, 15 Nov 2024 10:20:18 +0100 Subject: [PATCH] feat: change the absolute path by relative path --- .../src/main/resources/nrtm_client_schema.sql | 1 - .../db/nrtm4/client/client/NrtmRestClient.java | 2 +- .../net/ripe/db/nrtm4/client/NrtmServerDummy.java | 14 +++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/whois-commons/src/main/resources/nrtm_client_schema.sql b/whois-commons/src/main/resources/nrtm_client_schema.sql index 58e25b4347..55fca8b4c0 100644 --- a/whois-commons/src/main/resources/nrtm_client_schema.sql +++ b/whois-commons/src/main/resources/nrtm_client_schema.sql @@ -17,7 +17,6 @@ DROP TABLE IF EXISTS `version`; DROP TABLE IF EXISTS `public_key`; -DROP TABLE IF EXISTS `last_mirror`; DROP TABLE IF EXISTS `version_info`; CREATE TABLE `version` diff --git a/whois-nrtm4-client/src/main/java/net/ripe/db/nrtm4/client/client/NrtmRestClient.java b/whois-nrtm4-client/src/main/java/net/ripe/db/nrtm4/client/client/NrtmRestClient.java index e08b8e76c6..8cf7d3cb1f 100644 --- a/whois-nrtm4-client/src/main/java/net/ripe/db/nrtm4/client/client/NrtmRestClient.java +++ b/whois-nrtm4-client/src/main/java/net/ripe/db/nrtm4/client/client/NrtmRestClient.java @@ -89,7 +89,7 @@ public UpdateNotificationFileResponse getNotificationFile(final String source){ @Nullable public byte[] getSnapshotFile(final String url){ try { - final Response response = client.target(url) + final Response response = client.target(String.format("%s/%s", baseUrl, url)) .request(MediaType.APPLICATION_OCTET_STREAM) .header(HttpHeader.X_FORWARDED_PROTO.asString(), HttpScheme.HTTPS.asString()) .get(Response.class); diff --git a/whois-nrtm4-client/src/test/java/net/ripe/db/nrtm4/client/NrtmServerDummy.java b/whois-nrtm4-client/src/test/java/net/ripe/db/nrtm4/client/NrtmServerDummy.java index 353000d0e0..2c33a6c1e7 100644 --- a/whois-nrtm4-client/src/test/java/net/ripe/db/nrtm4/client/NrtmServerDummy.java +++ b/whois-nrtm4-client/src/test/java/net/ripe/db/nrtm4/client/NrtmServerDummy.java @@ -57,13 +57,13 @@ public class NrtmServerDummy implements Stub { "version": 1, "snapshot": { "version": 1, - "url": "http://localhost:%s/nrtmv4/RIPE/nrtm-snapshot.4.RIPE.4521174b-548f-4e51-98fc-dfd720011a0c.82542bd048e111fe57db404d08b6433e.json.gz", + "url": "RIPE/nrtm-snapshot.4.RIPE.4521174b-548f-4e51-98fc-dfd720011a0c.82542bd048e111fe57db404d08b6433e.json.gz", "hash": "%s" }, "deltas": [ { "version": 1, - "url": "http://localhost:%s/nrtmv4/RIPE/nrtm-delta.4.RIPE.4521174b-548f-4e51-98fc-dfd720011a0c.e3be41ff312010046b67d099faa58f44.json", + "url": "RIPE/nrtm-delta.4.RIPE.4521174b-548f-4e51-98fc-dfd720011a0c.e3be41ff312010046b67d099faa58f44.json", "hash": "c50dd7554cb35ef5f2f45d7bfa09fc51033cbe1152d29b36cb1178319e22be3e" } ] @@ -80,7 +80,7 @@ public class NrtmServerDummy implements Stub { "version": 1, "snapshot": { "version": 1, - "url": "http://localhost:%s/nrtmv4/RIPE-NONAUTH/nrtm-snapshot.1.RIPE-NONAUTH.6328095e-7d46-415b-9333-8f2ae274b7c8.f1195bb8a666fe7b97fa74009a70cefa.json.gz", + "url": "RIPE-NONAUTH/nrtm-snapshot.1.RIPE-NONAUTH.6328095e-7d46-415b-9333-8f2ae274b7c8.f1195bb8a666fe7b97fa74009a70cefa.json.gz", "hash": "%s" }, "deltas": [] @@ -263,18 +263,18 @@ public Object response() { } private String getFakeUpdateNotificationRipeResponse(){ - return String.format(unfRipeTemplate, port, "fake_hash", port); + return String.format(unfRipeTemplate, "fake_hash"); } private String getFakeUpdateNotificationNonAuthResponse(){ - return String.format(unfRipeNonAuthTemplate, port, "fake_hash"); + return String.format(unfRipeNonAuthTemplate, "fake_hash"); } private String getUpdateNotificationFileRipeResponse(){ - return String.format(unfRipeTemplate, port, "b8fe5f2ae046e37a34c0228c237e824ac4c53d973beb81495b0e9526b4607c19", port); + return String.format(unfRipeTemplate, "b8fe5f2ae046e37a34c0228c237e824ac4c53d973beb81495b0e9526b4607c19"); } private String getUpdateNotificationFileNonAuthResponse(){ - return String.format(unfRipeNonAuthTemplate, port, "148c3c411b8f044f5fc0ab201f6dd03e80c862e27ad1a63488aee337dc7eb4a2"); + return String.format(unfRipeNonAuthTemplate, "148c3c411b8f044f5fc0ab201f6dd03e80c862e27ad1a63488aee337dc7eb4a2"); } }