-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReproducerResourceTest.java
39 lines (31 loc) · 1.05 KB
/
ReproducerResourceTest.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
package com.bakdata.reproducer;
import static io.restassured.RestAssured.given;
import static org.assertj.core.api.Assertions.assertThat;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.http.ContentType;
import io.restassured.specification.RequestSpecification;
import org.junit.jupiter.api.Test;
@QuarkusTest
public class ReproducerResourceTest {
@Test
public void defaultDtoTest() {
final DefaultDto defaultDto = baseRequest()
.get("reproducer/default")
.then()
.statusCode(200)
.extract()
.as(DefaultDto.class);
assertThat(defaultDto.getTitle()).isNotNull();
assertThat(defaultDto.getDateTime()).isNotNull();
}
@Test
public void customSerializerDtoTest() {
baseRequest()
.get("reproducer/custom")
.then()
.statusCode(500);
}
private static RequestSpecification baseRequest() {
return given().when().log().everything().contentType(ContentType.JSON);
}
}