Skip to content

Commit

Permalink
Rebase cleanup, update to response codes
Browse files Browse the repository at this point in the history
  • Loading branch information
zack-rma committed Feb 20, 2025
1 parent 52f111f commit 88ba624
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ public static TomcatServer getCurrentTomcat()
return currentTomcat;
}

public static Configuration getCurrentConfig()
{
return currentConfig;
}

@Override
public void beforeEach(ExtensionContext context) throws Exception
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
import static java.util.stream.Collectors.joining;
import static org.hamcrest.Matchers.is;

class BaseIT
public class BaseIT
{
protected static String authHeader = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.opendcs.odcsapi.fixtures.DatabaseContextProvider;

import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
Expand Down Expand Up @@ -108,7 +107,7 @@ void setUp() throws Exception
.then()
.log().ifValidationFails(LogDetail.ALL, true)
.assertThat()
.statusCode(is(HttpServletResponse.SC_OK))
.statusCode(is(HttpServletResponse.SC_CREATED))
.extract()
;

Expand Down Expand Up @@ -299,7 +298,7 @@ void tearDown() throws Exception
.then()
.log().ifValidationFails(LogDetail.ALL, true)
.assertThat()
.statusCode(is(HttpServletResponse.SC_OK))
.statusCode(is(HttpServletResponse.SC_NO_CONTENT))
;

// Delete the application
Expand Down Expand Up @@ -874,7 +873,7 @@ private Long storeSite(String jsonPath) throws Exception
.then()
.log().ifValidationFails(LogDetail.ALL, true)
.assertThat()
.statusCode(is(HttpServletResponse.SC_OK))
.statusCode(is(HttpServletResponse.SC_CREATED))
.extract()
;

Expand All @@ -896,7 +895,7 @@ private void tearDownSite(Long siteId)
.then()
.log().ifValidationFails(LogDetail.ALL, true)
.assertThat()
.statusCode(is(HttpServletResponse.SC_OK))
.statusCode(is(HttpServletResponse.SC_NO_CONTENT))
;

given()
Expand Down Expand Up @@ -937,7 +936,7 @@ private Long storePlatform(String jsonPath, Long siteId) throws Exception
.then()
.log().ifValidationFails(LogDetail.ALL, true)
.assertThat()
.statusCode(is(HttpServletResponse.SC_OK))
.statusCode(is(HttpServletResponse.SC_CREATED))
.extract()
;

Expand All @@ -959,7 +958,7 @@ private void tearDownPlatform(Long platformId)
.then()
.log().ifValidationFails(LogDetail.ALL, true)
.assertThat()
.statusCode(is(HttpServletResponse.SC_OK))
.statusCode(is(HttpServletResponse.SC_NO_CONTENT))
;

given()
Expand All @@ -975,9 +974,7 @@ private void tearDownPlatform(Long platformId)
.then()
.log().ifValidationFails(LogDetail.ALL, true)
.assertThat()
// TODO: This is here to support older implementations of the PlatformResources controller and should be removed
.statusCode(anyOf(is(HttpServletResponse.SC_NOT_FOUND),
is(HttpServletResponse.SC_GONE)))
.statusCode(is(HttpServletResponse.SC_NOT_FOUND))
;
}
}

0 comments on commit 88ba624

Please sign in to comment.