Skip to content

Commit 40c2e4e

Browse files
authored
Use Hamcrest assertions instead of JUnit in tests/integration/webclient (helidon-io#1749) (helidon-io#5196)
1 parent e31c240 commit 40c2e4e

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

  • tests/integration/webclient/src/test/java/io/helidon/tests/integration/webclient

tests/integration/webclient/src/test/java/io/helidon/tests/integration/webclient/RequestTest.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2021 Oracle and/or its affiliates.
2+
* Copyright (c) 2020, 2022 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,6 @@
2828
import jakarta.json.Json;
2929
import jakarta.json.JsonBuilderFactory;
3030
import jakarta.json.JsonObject;
31-
import org.junit.jupiter.api.Assertions;
3231
import org.junit.jupiter.api.Test;
3332

3433
import static org.hamcrest.CoreMatchers.is;
@@ -59,7 +58,7 @@ public class RequestTest extends TestParent {
5958
public void testHelloWorld() throws ExecutionException, InterruptedException {
6059
webClient.get()
6160
.request(JsonObject.class)
62-
.thenAccept(jsonObject -> Assertions.assertEquals("Hello World!", jsonObject.getString("message")))
61+
.thenAccept(jsonObject -> assertThat(jsonObject.getString("message"), is("Hello World!")))
6362
.toCompletableFuture()
6463
.get();
6564
}
@@ -84,7 +83,7 @@ public void testFollowRedirect() throws ExecutionException, InterruptedException
8483
webClient.get()
8584
.path("/redirect")
8685
.request(JsonObject.class)
87-
.thenAccept(jsonObject -> Assertions.assertEquals("Hello World!", jsonObject.getString("message")))
86+
.thenAccept(jsonObject -> assertThat(jsonObject.getString("message"), is("Hello World!")))
8887
.toCompletableFuture()
8988
.get();
9089

@@ -103,7 +102,7 @@ public void testFollowRedirectPath() {
103102
.path("/redirectPath")
104103
.request(JsonObject.class)
105104
.await();
106-
Assertions.assertEquals("Hello World!", jsonObject.getString("message"));
105+
assertThat(jsonObject.getString("message"), is("Hello World!"));
107106
}
108107

109108
@Test
@@ -132,10 +131,10 @@ public void testPut() throws Exception {
132131
webClient.put()
133132
.path("/greeting")
134133
.submit(JSON_NEW_GREETING)
135-
.thenAccept(response -> Assertions.assertEquals(204, response.status().code()))
134+
.thenAccept(response -> assertThat(response.status().code(), is(204)))
136135
.thenCompose(nothing -> webClient.get()
137136
.request(JsonObject.class))
138-
.thenAccept(jsonObject -> Assertions.assertEquals("Hola World!", jsonObject.getString("message")))
137+
.thenAccept(jsonObject -> assertThat(jsonObject.getString("message"), is("Hola World!")))
139138
.thenCompose(nothing -> webClient.put()
140139
.path("/greeting")
141140
.submit(JSON_OLD_GREETING))

0 commit comments

Comments
 (0)