Skip to content

Commit

Permalink
Assert status code
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Oct 18, 2024
1 parent c135492 commit e49214b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.opensearch.security;

import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope;
import org.apache.http.HttpStatus;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.ClassRule;
Expand Down Expand Up @@ -67,6 +68,7 @@ public void testStoredWithWithApplicableMaskedFieldRestrictions() {
]
}
""");
fieldSearchResponse.assertStatusCode(HttpStatus.SC_OK);
Assert.assertTrue(fieldSearchResponse.getBody().contains("raw"));
Assert.assertTrue(fieldSearchResponse.getBody().contains("hello"));
Assert.assertTrue(fieldSearchResponse.getBody().contains("restricted"));
Expand All @@ -88,6 +90,7 @@ public void testStoredWithWithApplicableFlsRestrictions() {
]
}
""");
fieldSearchResponse.assertStatusCode(HttpStatus.SC_OK);
Assert.assertTrue(fieldSearchResponse.getBody().contains("raw"));
Assert.assertTrue(fieldSearchResponse.getBody().contains("hello"));
Assert.assertFalse(fieldSearchResponse.getBody().contains("restricted"));
Expand Down

0 comments on commit e49214b

Please sign in to comment.