Skip to content

Commit

Permalink
project: upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ibodrov committed Apr 7, 2024
1 parent fde3292 commit ad6ba68
Show file tree
Hide file tree
Showing 30 changed files with 226 additions and 167 deletions.
4 changes: 2 additions & 2 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-standalone</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
38 changes: 9 additions & 29 deletions client2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>

<!-- JSON processing: jackson -->
<dependency>
Expand Down Expand Up @@ -66,8 +70,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-standalone</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -133,37 +137,13 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.revapi</groupId>
<artifactId>revapi-maven-plugin</artifactId>
<configuration>
<analysisConfiguration>
<revapi.differences>
<differences>
<item>
<ignore>true</ignore>
<code>java.annotation.attributeValueChanged</code>
<old>class com.walmartlabs.concord.client2.UserEntry</old>
<justification>Adding field to json-serializable class</justification>
</item>
<item>
<ignore>true</ignore>
<code>java.field.serialVersionUIDUnchanged</code>
<old>field com.walmartlabs.concord.client2.UserEntry.serialVersionUID</old>
<justification>Adding field to json-serializable class</justification>
</item>
</differences>
</revapi.differences>
<revapi.ignore>
<item>
<code>java.class.nonPublicPartOfAPI</code>
</item>
<item>
<code>java.class.removed</code>
</item>
</revapi.ignore>
</analysisConfiguration>
<!-- lots of incompatible changes due to breaking changes in dependencies -->
<!-- re-enable after release -->
<skip>true</skip>
</configuration>
</plugin>
</plugins>
Expand Down
4 changes: 2 additions & 2 deletions it/runtime-v2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-standalone</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import ca.ibodrov.concord.testcontainers.ContainerType;
import ca.ibodrov.concord.testcontainers.junit5.ConcordRule;
import com.github.tomakehurst.wiremock.client.WireMock;
import com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;
import com.github.tomakehurst.wiremock.junit5.WireMockExtension;
import com.walmartlabs.concord.client2.*;
import com.walmartlabs.concord.common.IOUtils;
Expand Down Expand Up @@ -57,7 +56,7 @@ public class TemplateIT extends AbstractTest {
public static WireMockExtension rule = WireMockExtension.newInstance()
.options(wireMockConfig()
.dynamicPort()
.extensions(new ResponseTemplateTransformer(false)))
.globalTemplating(true))
.build();

@RegisterExtension
Expand Down
4 changes: 2 additions & 2 deletions it/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-standalone</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* =====
*/

import com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;
import com.github.tomakehurst.wiremock.junit5.WireMockExtension;
import com.walmartlabs.concord.client2.ProcessEntry;
import com.walmartlabs.concord.client2.StartProcessResponse;
Expand All @@ -45,7 +44,8 @@ public class DependencyManagerIT extends AbstractServerIT {
static WireMockExtension rule = WireMockExtension.newInstance()
.options(wireMockConfig()
.dynamicPort()
.extensions(new HttpTaskIT.RequestHeaders(), new ResponseTemplateTransformer(false)))
.globalTemplating(true)
.extensions(new HttpTaskIT.RequestHeaders()))
.build();

@BeforeEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@
import com.github.tomakehurst.wiremock.common.FileSource;
import com.github.tomakehurst.wiremock.extension.Parameters;
import com.github.tomakehurst.wiremock.extension.ResponseDefinitionTransformer;
import com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer;
import com.github.tomakehurst.wiremock.http.HttpHeader;
import com.github.tomakehurst.wiremock.http.Request;
import com.github.tomakehurst.wiremock.http.ResponseDefinition;
import com.github.tomakehurst.wiremock.junit5.WireMockExtension;
import com.walmartlabs.concord.client2.ProcessApi;
import com.walmartlabs.concord.client2.ProcessEntry;
import com.walmartlabs.concord.client2.StartProcessResponse;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -74,10 +72,11 @@ public class HttpTaskIT extends AbstractServerIT {
}

@RegisterExtension
final WireMockExtension rule = WireMockExtension.newInstance()
public static final WireMockExtension rule = WireMockExtension.newInstance()
.options(wireMockConfig()
.dynamicPort()
.extensions(new RequestHeaders(), new ResponseTemplateTransformer(false)))
.globalTemplating(true)
.extensions(new RequestHeaders()))
.build();

@BeforeEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import static com.github.tomakehurst.wiremock.client.WireMock.*;
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;
import static com.walmartlabs.concord.it.common.ITUtils.archive;
import static com.walmartlabs.concord.it.common.ServerClient.assertLog;
import static com.walmartlabs.concord.it.common.ServerClient.waitForCompletion;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

public class NodeRosterIT extends AbstractServerIT {

Expand Down
4 changes: 2 additions & 2 deletions plugins/tasks/http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-standalone</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ protected void stubForJsonResponse() {
.withHeader("Content-Type", "application/json")
.withHeader("Accept", "application/json")
.withBody("[\n" +
" {\n" +
" \"id\": 1,\n" +
" \"version\": \"1.0\"\n" +
" },\n" +
" {\n" +
" \"id\": 2,\n" +
" \"test\": \"1.1\"\n" +
" }\n" +
"]"))
" {\n" +
" \"id\": 1,\n" +
" \"version\": \"1.0\"\n" +
" },\n" +
" {\n" +
" \"id\": 2,\n" +
" \"test\": \"1.1\"\n" +
" }\n" +
"]"))
);
}

Expand Down Expand Up @@ -153,8 +153,8 @@ protected void stubForPostRequest() {
.withHeader("Content-Type", "application/json")
.withHeader("Accept", "application/json")
.withBody("{\n" +
" \"message\": \"Success\"\n" +
"}"))
" \"message\": \"Success\"\n" +
"}"))
);
}

Expand Down Expand Up @@ -192,11 +192,11 @@ protected void stubForPostRequestForRequestTypeFile() {
.withStatus(200)
.withHeader("Content-Type", "application/json")
.withBody("{\n" +
" \"testObject\": {\n" +
" \"testString\": \"hello\",\n" +
" \"testInteger\": \"2\"\n" +
" }\n" +
"}"))
" \"testObject\": {\n" +
" \"testString\": \"hello\",\n" +
" \"testInteger\": \"2\"\n" +
" }\n" +
"}"))
);
}

Expand Down Expand Up @@ -247,8 +247,8 @@ protected void stubForDeleteRequest() {
.withHeader("Content-Type", "application/json")
.withHeader("Accept", "application/json")
.withBody("{\n" +
" \"message\": \"Success\"\n" +
"}"))
" \"message\": \"Success\"\n" +
"}"))
);
}

Expand All @@ -259,8 +259,8 @@ protected void stubForPatchRequest() {
.withHeader("Content-Type", "application/json")
.withHeader("Accept", "application/json")
.withBody("{\n" +
" \"message\": \"Success\"\n" +
"}"))
" \"message\": \"Success\"\n" +
"}"))
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void testExecutePostRequestForMultipart(WireMockRuntimeInfo wmRuntimeInfo

@Test
public void testExecuteForException(WireMockRuntimeInfo wmRuntimeInfo) throws Exception {
assertThrows(Exception.class, () -> {
assertThrows(Exception.class, () -> {
initCxtForRequest(mockContext, "GET", "string", "string",
"http://localhost:" + wmRuntimeInfo.getHttpPort() + "/fault", false, 0, true);
task.execute(mockContext);
Expand Down Expand Up @@ -181,7 +181,7 @@ public void testExecutePostRequestWithFollowRedirect(WireMockRuntimeInfo wmRunti

@Test
public void testIllegalArgumentExceptionForRequest() {
assertThrows(IllegalArgumentException.class, () -> {
assertThrows(IllegalArgumentException.class, () -> {
task.execute(mockContext);
});
}
Expand Down Expand Up @@ -226,7 +226,7 @@ public void testFilePostRequest(WireMockRuntimeInfo wmRuntimeInfo) throws Except

@Test
public void testForMissingWorkDirForFileGetRequest(WireMockRuntimeInfo wmRuntimeInfo) {
assertThrows(IllegalArgumentException.class, () -> {
assertThrows(IllegalArgumentException.class, () -> {
// Working directory is mandatory for response type file
initCxtForRequest(mockContext, "GET", "json", "file",
"http://localhost:" + wmRuntimeInfo.getHttpPort() + "/stringFile", false, 0, true);
Expand Down Expand Up @@ -277,7 +277,7 @@ public void testFileGetWithResponseTypeJSON(WireMockRuntimeInfo wmRuntimeInfo, @

@Test
public void testPostJsonRequestForIncompatibleBody(WireMockRuntimeInfo wmRuntimeInfo) {
assertThrows(IllegalArgumentException.class, () -> {
assertThrows(IllegalArgumentException.class, () -> {
initCxtForRequest(mockContext, "POST", "json", "string",
"http://localhost:" + wmRuntimeInfo.getHttpPort() + "/post", false, 0, true);
when(mockContext.getVariable("body")).thenReturn("src/test/resources/__files/file.bin");
Expand All @@ -287,7 +287,7 @@ public void testPostJsonRequestForIncompatibleBody(WireMockRuntimeInfo wmRuntime

@Test
public void testPostStringRequestForIncompatibleComplexBody(WireMockRuntimeInfo wmRuntimeInfo) {
assertThrows(IllegalArgumentException.class, () -> {
assertThrows(IllegalArgumentException.class, () -> {
initCxtForRequest(mockContext, "POST", "string", "string",
"http://localhost:" + wmRuntimeInfo.getHttpPort() + "/post", false, 0, true);
when(mockContext.getVariable("body")).thenReturn(new HashMap<>());
Expand All @@ -297,7 +297,7 @@ public void testPostStringRequestForIncompatibleComplexBody(WireMockRuntimeInfo

@Test
public void testPostFileRequestForIncompatibleComplexBody(WireMockRuntimeInfo wmRuntimeInfo) {
assertThrows(IllegalArgumentException.class, () -> {
assertThrows(IllegalArgumentException.class, () -> {
initCxtForRequest(mockContext, "POST", "file", "string",
"http://localhost:" + wmRuntimeInfo.getHttpPort() + "/post", false, 0, true);
when(mockContext.getVariable("body")).thenReturn(new HashMap<>());
Expand All @@ -307,7 +307,7 @@ public void testPostFileRequestForIncompatibleComplexBody(WireMockRuntimeInfo wm

@Test
public void testInvalidRequestMethodType(WireMockRuntimeInfo wmRuntimeInfo) {
assertThrows(IllegalArgumentException.class, () -> {
assertThrows(IllegalArgumentException.class, () -> {
initCxtForRequest(mockContext, "GET1", "json", "file",
"http://localhost:" + wmRuntimeInfo.getHttpPort() + "/file", false, 0, true);
task.execute(mockContext);
Expand All @@ -316,7 +316,7 @@ public void testInvalidRequestMethodType(WireMockRuntimeInfo wmRuntimeInfo) {

@Test
public void testInvalidRequestType(WireMockRuntimeInfo wmRuntimeInfo) {
assertThrows(IllegalArgumentException.class, () -> {
assertThrows(IllegalArgumentException.class, () -> {
initCxtForRequest(mockContext, "GET", "json1", "file",
"http://localhost:" + wmRuntimeInfo.getHttpPort() + "/file", false, 0, true);
task.execute(mockContext);
Expand All @@ -325,7 +325,7 @@ public void testInvalidRequestType(WireMockRuntimeInfo wmRuntimeInfo) {

@Test
public void testInvalidResponseType(WireMockRuntimeInfo wmRuntimeInfo) {
assertThrows(IllegalArgumentException.class, () -> {
assertThrows(IllegalArgumentException.class, () -> {
initCxtForRequest(mockContext, "GET", "json", "file1",
"http://localhost:" + wmRuntimeInfo.getHttpPort() + "/file", false, 0, true);
task.execute(mockContext);
Expand Down Expand Up @@ -364,7 +364,7 @@ public void testPatch(WireMockRuntimeInfo wmRuntimeInfo) throws Exception {

@Test
public void testRequestTimeoutException(WireMockRuntimeInfo wmRuntimeInfo) {
assertThrows(RequestTimeoutException.class, () -> {
assertThrows(RequestTimeoutException.class, () -> {
initCxtForRequest(mockContext, "GET", "string", "string",
"http://localhost:" + wmRuntimeInfo.getHttpPort() + "/requestTimeout", false, 5000, true);
task.execute(mockContext);
Expand All @@ -373,7 +373,7 @@ public void testRequestTimeoutException(WireMockRuntimeInfo wmRuntimeInfo) {

@Test
public void testInvalidJsonResponse(WireMockRuntimeInfo wmRuntimeInfo) {
assertThrows(RuntimeException.class, () -> {
assertThrows(RuntimeException.class, () -> {
initCxtForRequest(mockContext, "GET", "json", "json",
"http://localhost:" + wmRuntimeInfo.getHttpPort() + "/invalid/json", false, 0, true);
task.execute(mockContext);
Expand All @@ -382,7 +382,7 @@ public void testInvalidJsonResponse(WireMockRuntimeInfo wmRuntimeInfo) {

@Test
public void testInvalidRequestMethod(WireMockRuntimeInfo wmRuntimeInfo) {
assertThrows(IllegalArgumentException.class, () -> {
assertThrows(IllegalArgumentException.class, () -> {
initCxtForRequest(mockContext, 123, "json", "json",
"http://localhost:" + wmRuntimeInfo.getHttpPort() + "/json", false, 0, true);
task.execute(mockContext);
Expand All @@ -391,7 +391,7 @@ public void testInvalidRequestMethod(WireMockRuntimeInfo wmRuntimeInfo) {

@Test
public void testInvalidRequest(WireMockRuntimeInfo wmRuntimeInfo) {
assertThrows(IllegalArgumentException.class, () -> {
assertThrows(IllegalArgumentException.class, () -> {
initCxtForRequest(mockContext, "GET", 123, "json",
"http://localhost:" + wmRuntimeInfo.getHttpPort() + "/json", false, 0, true);
task.execute(mockContext);
Expand All @@ -400,7 +400,7 @@ public void testInvalidRequest(WireMockRuntimeInfo wmRuntimeInfo) {

@Test
public void testInvalidResponse(WireMockRuntimeInfo wmRuntimeInfo) {
assertThrows(IllegalArgumentException.class, () -> {
assertThrows(IllegalArgumentException.class, () -> {
initCxtForRequest(mockContext, "GET", "json", 123,
"http://localhost:" + wmRuntimeInfo.getHttpPort() + "/json", false, 0, true);
task.execute(mockContext);
Expand Down
Loading

0 comments on commit ad6ba68

Please sign in to comment.