New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port unit and integration tests to JUnit 5 #432

Merged
merged 2 commits into from Sep 4, 2018
Jump to file or symbol
Failed to load files and symbols.
+718 −835
Diff settings

Always

Just for now

@@ -4,7 +4,6 @@
== ServiceAdapterOptions
++++
Options describing how an ServiceAdapter will make connections with external HTTP services.
++++
'''
@@ -104,6 +103,9 @@ Configure when to collect access log. True if after request arrives, false after
[[AdapterRequest]]
== AdapterRequest
++++
++++
'''
[cols=">25%,^25%,50%"]
[frame="topbot"]
@@ -125,6 +127,9 @@ Set the client request
[[AdapterResponse]]
== AdapterResponse
++++
++++
'''
[cols=">25%,^25%,50%"]
[frame="topbot"]
@@ -56,22 +56,10 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-unit</artifactId>
@@ -71,21 +71,13 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
@@ -47,7 +47,6 @@
import org.junit.runner.RunWith;
import org.mockito.Matchers;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
@RunWith(VertxUnitRunner.class)
public class HttpClientFacadeTest {
@@ -80,7 +79,7 @@ public void whenSupportedStaticPathServiceRequested_expectRequestExecutedAndResp
TestContext context) throws Exception {
Async async = context.async();
// given
final WebClient mockedWebClient = PowerMockito.spy(webClient());
final WebClient mockedWebClient = Mockito.spy(webClient());
HttpClientFacade clientFacade = new HttpClientFacade(mockedWebClient,
getConfiguration());
final JsonObject expectedResponse = new JsonObject(FileReader.readText("first-response.json"));
@@ -109,7 +108,7 @@ public void whenSupportedDynamicPathServiceRequested_expectRequestExecutedAndRes
TestContext context) throws Exception {
Async async = context.async();
// given
final WebClient mockedWebClient = PowerMockito.spy(webClient());
final WebClient mockedWebClient = Mockito.spy(webClient());
HttpClientFacade clientFacade = new HttpClientFacade(mockedWebClient,
getConfiguration());
final JsonObject expectedResponse = new JsonObject(FileReader.readText("first-response.json"));
@@ -141,7 +140,7 @@ public void whenServiceRequestedWithoutPathParam_expectNoServiceRequestAndBadReq
TestContext context) throws Exception {
Async async = context.async();
// given
final WebClient mockedWebClient = PowerMockito.spy(webClient());
final WebClient mockedWebClient = Mockito.spy(webClient());
HttpClientFacade clientFacade = new HttpClientFacade(mockedWebClient,
getConfiguration());
@@ -168,7 +167,7 @@ public void whenUnsupportedPathServiceRequested_expectNoServiceRequestAndBadRequ
TestContext context) throws Exception {
Async async = context.async();
// given
final WebClient mockedWebClient = PowerMockito.spy(webClient());
final WebClient mockedWebClient = Mockito.spy(webClient());
HttpClientFacade clientFacade = new HttpClientFacade(mockedWebClient,
getConfiguration());
@@ -197,7 +196,7 @@ public void whenServiceEmptyResponse_expectNoFailure(
TestContext context) throws Exception {
Async async = context.async();
// given
final WebClient mockedWebClient = PowerMockito.spy(webClient());
final WebClient mockedWebClient = Mockito.spy(webClient());
HttpClientFacade clientFacade = new HttpClientFacade(mockedWebClient,
getConfiguration());
View
@@ -29,7 +29,9 @@
<artifactId>knotx-core</artifactId>
<name>Knot.x Core</name>
<description>Core Knot.x module consisting of Server, Repositories, Splitter, Assembler and Gateway.</description>
<description>Core Knot.x module consisting of Server, Repositories, Splitter, Assembler and
Gateway.
</description>
<dependencies>
<dependency>
@@ -113,14 +115,55 @@
</dependency>
<!-- Tests -->
<dependency>
<groupId>io.knotx</groupId>
<artifactId>knotx-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-unit</artifactId>
<artifactId>vertx-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-migrationsupport</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-unit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.stefanbirkner</groupId>
@@ -138,10 +181,6 @@
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
@@ -17,6 +17,7 @@
import io.vertx.codegen.annotations.DataObject;
import io.vertx.core.json.JsonObject;
import org.apache.commons.lang3.StringUtils;
/**
* Describes SnippetOptions Knot configuration
@@ -106,7 +107,7 @@ public String getParamsPrefix() {
* @return a reference to this, so the API can be used fluently
*/
public SnippetOptions setParamsPrefix(String paramsPrefix) {
this.paramsPrefix = paramsPrefix;
this.paramsPrefix = paramsPrefix == null ? StringUtils.EMPTY : paramsPrefix;
return this;
}
}
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.