From 316267a06b5a44a4763311597deb1bed9270cfbf Mon Sep 17 00:00:00 2001 From: Pavel Strunkin Date: Tue, 18 Aug 2020 21:29:45 +0200 Subject: [PATCH] sto build http method fixed https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker/issues/97 --- .../sdk_java/VisualRegressionTracker.java | 1 + .../sdk_java/VisualRegressionTrackerTest.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/java/io/visual_regression_tracker/sdk_java/VisualRegressionTracker.java b/src/main/java/io/visual_regression_tracker/sdk_java/VisualRegressionTracker.java index abf82ba..379b8b3 100644 --- a/src/main/java/io/visual_regression_tracker/sdk_java/VisualRegressionTracker.java +++ b/src/main/java/io/visual_regression_tracker/sdk_java/VisualRegressionTracker.java @@ -77,6 +77,7 @@ public void stop() throws IOException { Request request = new Request.Builder() .url(this.visualRegressionTrackerConfig.getApiUrl().concat("/builds/").concat(this.buildId)) .addHeader(apiKeyHeaderName, this.visualRegressionTrackerConfig.getApiKey()) + .patch(RequestBody.create("", JSON)) .build(); client.newCall(request).execute(); diff --git a/src/test/java/io/visual_regression_tracker/sdk_java/VisualRegressionTrackerTest.java b/src/test/java/io/visual_regression_tracker/sdk_java/VisualRegressionTrackerTest.java index af0026a..a067a00 100644 --- a/src/test/java/io/visual_regression_tracker/sdk_java/VisualRegressionTrackerTest.java +++ b/src/test/java/io/visual_regression_tracker/sdk_java/VisualRegressionTrackerTest.java @@ -153,6 +153,7 @@ public void shouldStopBuild() throws IOException, InterruptedException { vrt.stop(); RecordedRequest request = server.takeRequest(); + MatcherAssert.assertThat(request.getMethod(), CoreMatchers.is("PATCH")); MatcherAssert.assertThat(request.getHeader(vrt.apiKeyHeaderName), CoreMatchers.is(config.getApiKey())); MatcherAssert.assertThat(Objects.requireNonNull(request.getRequestUrl()).encodedPath(), CoreMatchers.containsString(buildId)); }