File tree 1 file changed +4
-5
lines changed
plugins/discovery-ec2/src/test/java/org/elasticsearch/discovery/ec2
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -197,12 +197,11 @@ public void testInvalidHostType() throws InterruptedException {
197
197
Settings nodeSettings = Settings .builder ()
198
198
.put (DISCOVERY_EC2 .HOST_TYPE_SETTING .getKey (), "does_not_exist" )
199
199
.build ();
200
- try {
200
+
201
+ IllegalArgumentException exception = expectThrows (IllegalArgumentException .class , () -> {
201
202
buildDynamicNodes (nodeSettings , 1 );
202
- fail ("Expected IllegalArgumentException" );
203
- } catch (IllegalArgumentException e ) {
204
- assertThat (e .getMessage (), containsString ("does_not_exist is unknown for discovery.ec2.host_type" ));
205
- }
203
+ });
204
+ assertThat (exception .getMessage (), containsString ("does_not_exist is unknown for discovery.ec2.host_type" ));
206
205
}
207
206
208
207
public void testFilterByTags () throws InterruptedException {
You can’t perform that action at this time.
0 commit comments