Skip to content

Commit 05e9cbf

Browse files
committed
Fix Helidon matrix parameter test, bump test dependencies
1 parent 931f71f commit 05e9cbf

File tree

7 files changed

+60
-22
lines changed

7 files changed

+60
-22
lines changed

pom.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<groupId>org.avaje</groupId>
1212
<artifactId>java8-oss</artifactId>
13-
<version>2.1</version>
13+
<version>2.2</version>
1414
</parent>
1515

1616
<scm>
@@ -22,7 +22,14 @@
2222
<dependency>
2323
<groupId>org.junit.jupiter</groupId>
2424
<artifactId>junit-jupiter-api</artifactId>
25-
<version>5.5.2</version>
25+
<version>5.6.2</version>
26+
<scope>test</scope>
27+
</dependency>
28+
29+
<dependency>
30+
<groupId>org.junit.jupiter</groupId>
31+
<artifactId>junit-jupiter-engine</artifactId>
32+
<version>5.6.2</version>
2633
<scope>test</scope>
2734
</dependency>
2835

tests/test-client/pom.xml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,32 +46,27 @@
4646
</dependency>
4747

4848

49-
5049
<dependency>
5150
<groupId>org.junit.jupiter</groupId>
5251
<artifactId>junit-jupiter-api</artifactId>
53-
<version>5.5.2</version>
52+
<version>5.6.2</version>
53+
<scope>test</scope>
54+
</dependency>
55+
56+
<dependency>
57+
<groupId>org.junit.jupiter</groupId>
58+
<artifactId>junit-jupiter-engine</artifactId>
59+
<version>5.6.2</version>
5460
<scope>test</scope>
5561
</dependency>
56-
<!-- <dependency>-->
57-
<!-- <groupId>io.helidon.webclient</groupId>-->
58-
<!-- <artifactId>helidon-webclient</artifactId>-->
59-
<!-- <version>${helidon-version}</version>-->
60-
<!-- <scope>test</scope>-->
61-
<!-- </dependency>-->
62+
6263
<dependency>
6364
<groupId>org.assertj</groupId>
6465
<artifactId>assertj-core</artifactId>
6566
<version>3.16.1</version>
6667
<scope>test</scope>
6768
</dependency>
68-
<!-- <dependency>-->
69-
<!-- <groupId>io.rest-assured</groupId>-->
70-
<!-- <artifactId>rest-assured</artifactId>-->
71-
<!-- <version>4.3.1</version>-->
72-
<!-- <scope>test</scope>-->
73-
<!-- </dependency>-->
74-
<!-- -->
69+
7570
</dependencies>
7671

7772
</project>

tests/test-helidon/pom.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>org.avaje</groupId>
1313
<artifactId>java11-oss</artifactId>
14-
<version>2.1.2</version>
14+
<version>2.2</version>
1515
</parent>
1616

1717
<properties>
@@ -86,9 +86,17 @@
8686
<dependency>
8787
<groupId>org.junit.jupiter</groupId>
8888
<artifactId>junit-jupiter-api</artifactId>
89-
<version>5.5.2</version>
89+
<version>5.6.2</version>
9090
<scope>test</scope>
9191
</dependency>
92+
93+
<dependency>
94+
<groupId>org.junit.jupiter</groupId>
95+
<artifactId>junit-jupiter-engine</artifactId>
96+
<version>5.6.2</version>
97+
<scope>test</scope>
98+
</dependency>
99+
92100
<dependency>
93101
<groupId>io.helidon.webclient</groupId>
94102
<artifactId>helidon-webclient</artifactId>

tests/test-helidon/src/main/java/org/example/FooController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void form2Test(ServerRequest req, ServerResponse res) {
9191
}
9292

9393
@Produces("text/plain")
94-
@Get("/withMatrix/:year;author;country/:other")
94+
@Get("/withMatrix/{year;author;country}/{other}")
9595
String getWithMatrixParam(int year, String author, String country, String other, String extra) {
9696
return "yr:" + year + " au:" + author + " co:" + country + " other:" + other + " extra:" + extra;
9797
}

tests/test-helidon/src/test/java/org/example/FooControllerTest.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
package org.example;
22

3+
import io.avaje.http.client.HttpClientContext;
4+
import io.dinject.controller.Get;
35
import io.restassured.response.Response;
46
import org.example.api.FooBody;
57
import org.junit.jupiter.api.Test;
68

9+
import java.net.http.HttpResponse;
10+
711
import static io.restassured.RestAssured.get;
812
import static io.restassured.RestAssured.given;
913
import static org.assertj.core.api.Assertions.assertThat;
@@ -12,6 +16,8 @@
1216

1317
class FooControllerTest extends BaseWebTest {
1418

19+
private final HttpClientContext client = client();
20+
1521
@Test
1622
void hello() {
1723
final Response response = get(baseUrl + "/foo/hello");
@@ -42,8 +48,22 @@ void postIt() {
4248
}
4349

4450

51+
@Get("/withMatrix/:year;author;country/:other")
4552
@Test
4653
void getWithMatrixParam() {
54+
55+
final HttpResponse<String> res = client.request()
56+
.path("foo")
57+
.path("withMatrix")
58+
.path("2011").matrixParam("author", "rob").matrixParam("country", "nz")
59+
.path("foo")
60+
.param("extra", "banana")
61+
.get()
62+
.asString();
63+
64+
assertThat(res.statusCode()).isEqualTo(200);
65+
assertThat(res.body()).isEqualTo("yr:2011 au:rob co:nz other:foo extra:banana");
66+
4767
given()
4868
.get(baseUrl + "/foo/withMatrix/2011;author=rob;country=nz/foo?extra=banana")
4969
.then()

tests/test-helidon/src/test/resources/logback-test.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
</root>
1111

1212
<logger name="org.example" level="DEBUG"/>
13+
<logger name="io.avaje" level="TRACE"/>
1314

1415
</configuration>

tests/test-javalin/pom.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>org.avaje</groupId>
1313
<artifactId>java11-oss</artifactId>
14-
<version>2.1.2</version>
14+
<version>2.2</version>
1515
</parent>
1616

1717
<properties>
@@ -87,7 +87,14 @@
8787
<dependency>
8888
<groupId>org.junit.jupiter</groupId>
8989
<artifactId>junit-jupiter-api</artifactId>
90-
<version>5.5.2</version>
90+
<version>5.6.2</version>
91+
<scope>test</scope>
92+
</dependency>
93+
94+
<dependency>
95+
<groupId>org.junit.jupiter</groupId>
96+
<artifactId>junit-jupiter-engine</artifactId>
97+
<version>5.6.2</version>
9198
<scope>test</scope>
9299
</dependency>
93100

0 commit comments

Comments
 (0)