-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathSnsResourcesTest.java
42 lines (37 loc) · 1.35 KB
/
SnsResourcesTest.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
package org.acme.sns;
import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.any;
import io.quarkus.test.junit.QuarkusTest;
import jakarta.ws.rs.core.HttpHeaders;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response.Status;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
@QuarkusTest
public class SnsResourcesTest {
@ParameterizedTest
@ValueSource(strings = {"sync", "async"})
void testPublisher(final String testedResource) {
given()
.pathParam("resource", testedResource)
.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.body(String
.format("{\"flavor\":\"%s\", \"spin\":\"%s\"}", "Charm", "1/2"))
.when()
.post("/{resource}/cannon/shoot")
.then()
.statusCode(Status.OK.getStatusCode())
.body(any(String.class));
}
// @ParameterizedTest
// @ValueSource(strings = {"sync", "async"})
// void testSubscriber(final String testedResource) {
// given()
// .pathParam("resource", testedResource)
// .when()
// .post("/{resource}/shield/subscribe")
// .then()
// .statusCode(Status.OK.getStatusCode())
// .body(any(String.class));
// }
}