Skip to content

Commit 5fd97a2

Browse files
committed
Correct RollupDelete test
1 parent 137c832 commit 5fd97a2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/test/kotlin/org/opensearch/indexmanagement/rollup/resthandler/RestDeleteRollupActionIT.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,13 @@ class RestDeleteRollupActionIT : RollupRestTestCase() {
5050

5151
@Throws(Exception::class)
5252
fun `test deleting a rollup that doesn't exist in existing config index`() {
53-
createRandomRollup()
54-
val res = client().makeRequest("DELETE", "$ROLLUP_JOBS_BASE_URI/foobarbaz")
55-
assertEquals("Was not not_found response", "not_found", res.asMap()["result"])
53+
try {
54+
createRandomRollup()
55+
client().makeRequest("DELETE", "$ROLLUP_JOBS_BASE_URI/foobarbaz")
56+
fail("expected 404 ResponseException")
57+
} catch (e: ResponseException) {
58+
assertEquals(RestStatus.NOT_FOUND, e.response.restStatus())
59+
}
5660
}
5761

5862
@Throws(Exception::class)

0 commit comments

Comments
 (0)