forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuarkusRedisWithParameterInjectionTest.java
62 lines (52 loc) · 1.9 KB
/
QuarkusRedisWithParameterInjectionTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package io.quarkus.redis.it;
import org.hamcrest.CoreMatchers;
import org.junit.jupiter.api.Test;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
@QuarkusTest
class QuarkusRedisWithParameterInjectionTest {
static final String SYNC_KEY = "named-sync-key";
static final String SYNC_VALUE = "named-sync-value";
static final String REACTIVE_KEY = "named-reactive-key";
static final String REACTIVE_VALUE = "named-reactive-value";
@Test
public void sync() {
RestAssured.given()
.when()
.get("/quarkus-redis-parameter-injection/sync/" + SYNC_KEY)
.then()
.statusCode(204); // the key is not set yet
RestAssured.given()
.body(SYNC_VALUE)
.when()
.post("/quarkus-redis-parameter-injection/sync/" + SYNC_KEY)
.then()
.statusCode(204);
RestAssured.given()
.when()
.get("/quarkus-redis-parameter-injection/sync/" + SYNC_KEY)
.then()
.statusCode(200)
.body(CoreMatchers.is(SYNC_VALUE));
}
@Test
public void reactive() {
RestAssured.given()
.when()
.get("/quarkus-redis-parameter-injection/reactive/" + REACTIVE_KEY)
.then()
.statusCode(204); // the reactive key is not set yet
RestAssured.given()
.body(REACTIVE_VALUE)
.when()
.post("/quarkus-redis-parameter-injection/reactive/" + REACTIVE_KEY)
.then()
.statusCode(204);
RestAssured.given()
.when()
.get("/quarkus-redis-parameter-injection/reactive/" + REACTIVE_KEY)
.then()
.statusCode(200)
.body(CoreMatchers.is(REACTIVE_VALUE));
}
}