Skip to content

Commit

Permalink
added constants
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangoerdes committed Aug 24, 2023
1 parent d84ddd5 commit 9911e98
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

public class ContentTypeWildcardTests extends AbstractValidatorTest {

private static final String STAR_STAR_PATH = "/star-star";
private static final String STAR_JSON_PATH = "/star-json";
private static final String APPLICATION_STAR_PATH = "/application-star";

@Override
String getOpenAPIFileName() {
return "/openapi/specs/content-type-wildcards.yml";
Expand Down Expand Up @@ -38,17 +42,17 @@ void validateAndAssert(Request request, boolean expectedResult) {

@Test
void starStarTest() {
validateAndAssert(Request.post().json().path("/star-star").body("{}"), true);
validateAndAssert(Request.post().json().path(STAR_STAR_PATH).body("{}"), true);
}

@Test
void starTypeTest() {
validateAndAssert(Request.post().json().path("/star-json").body("{}"), false);
validateAndAssert(Request.post().json().path(STAR_JSON_PATH).body("{}"), false);
}

@Test
void typeStarTest() {
validateAndAssert(Request.post().json().path("/application-star").body("{}"), true);
validateAndAssert(Request.post().json().path(APPLICATION_STAR_PATH).body("{}"), true);
}

void responseTest(Request request, boolean expectedResult) throws ParseException {
Expand All @@ -60,16 +64,16 @@ void responseTest(Request request, boolean expectedResult) throws ParseException

@Test
void starStarResponseTest() throws ParseException {
responseTest(Request.post().json().path("/star-star").body("{}"), true);
responseTest(Request.post().json().path(STAR_STAR_PATH).body("{}"), true);
}

@Test
void starTypeResponseTest() throws ParseException {
responseTest(Request.post().json().path("/star-json").body("{}"), false);
responseTest(Request.post().json().path(STAR_JSON_PATH).body("{}"), false);
}

@Test
void typeStarResponseTest() throws ParseException {
responseTest(Request.post().json().path("/application-star").body("{}"), true);
responseTest(Request.post().json().path(APPLICATION_STAR_PATH).body("{}"), true);
}
}

0 comments on commit 9911e98

Please sign in to comment.