From 9911e98fc25c2e7830598ea4a7a237840cd26176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6rdes?= Date: Thu, 24 Aug 2023 10:59:09 +0200 Subject: [PATCH] added constants --- .../validators/ContentTypeWildcardTests.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/core/src/test/java/com/predic8/membrane/core/openapi/validators/ContentTypeWildcardTests.java b/core/src/test/java/com/predic8/membrane/core/openapi/validators/ContentTypeWildcardTests.java index b250fb067..17b6a4b83 100644 --- a/core/src/test/java/com/predic8/membrane/core/openapi/validators/ContentTypeWildcardTests.java +++ b/core/src/test/java/com/predic8/membrane/core/openapi/validators/ContentTypeWildcardTests.java @@ -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"; @@ -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 { @@ -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); } }