59
59
import org .opensearch .plugins .ActionPlugin ;
60
60
import org .opensearch .plugins .Plugin ;
61
61
import org .opensearch .repositories .RepositoriesService ;
62
+ import org .opensearch .rest .RestStatus ;
62
63
import org .opensearch .script .ScriptService ;
63
64
import org .opensearch .security .OpenSearchSecurityPlugin ;
64
65
import org .opensearch .security .support .ConfigConstants ;
@@ -221,6 +222,7 @@ public void testReplication() throws Exception {
221
222
log .warn (ex .getMessage ());
222
223
Assert .assertNotNull (ex );
223
224
Assert .assertTrue (ex .getMessage ().contains ("Cross Cluster Replication is not supported when FLS or DLS or Fieldmasking is activated" ));
225
+ Assert .assertEquals (ex .status (), RestStatus .FORBIDDEN );
224
226
}
225
227
226
228
try (Node node = new PluginAwareNode (false , tcSettings , Netty4Plugin .class , OpenSearchSecurityPlugin .class , MockReplicationPlugin .class ).start ()) {
@@ -230,6 +232,7 @@ public void testReplication() throws Exception {
230
232
log .warn (ex .getMessage ());
231
233
Assert .assertNotNull (ex );
232
234
Assert .assertTrue (ex .getMessage ().contains ("Cross Cluster Replication is not supported when FLS or DLS or Fieldmasking is activated" ));
235
+ Assert .assertEquals (ex .status (), RestStatus .FORBIDDEN );
233
236
}
234
237
235
238
try (Node node = new PluginAwareNode (false , tcSettings , Netty4Plugin .class , OpenSearchSecurityPlugin .class , MockReplicationPlugin .class ).start ()) {
@@ -239,6 +242,7 @@ public void testReplication() throws Exception {
239
242
log .warn (ex .getMessage ());
240
243
Assert .assertNotNull (ex );
241
244
Assert .assertTrue (ex .getMessage ().contains ("Cross Cluster Replication is not supported when FLS or DLS or Fieldmasking is activated" ));
245
+ Assert .assertEquals (ex .status (), RestStatus .FORBIDDEN );
242
246
}
243
247
244
248
try (Node node = new PluginAwareNode (false , tcSettings , Netty4Plugin .class , OpenSearchSecurityPlugin .class , MockReplicationPlugin .class ).start ()) {
0 commit comments