From e5b174ff77f4c42432b07f6884835fd8443a6700 Mon Sep 17 00:00:00 2001 From: javanna Date: Tue, 3 Feb 2015 15:47:42 +0100 Subject: [PATCH] [TEST] Move SimpleNettyTransportTests to expected exception Replaced try catch with expected exception, since no additional check was done on the exception thrown. --- .../transport/netty/SimpleNettyTransportTests.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/test/java/org/elasticsearch/transport/netty/SimpleNettyTransportTests.java b/src/test/java/org/elasticsearch/transport/netty/SimpleNettyTransportTests.java index 465929a1933..ab169618ddf 100644 --- a/src/test/java/org/elasticsearch/transport/netty/SimpleNettyTransportTests.java +++ b/src/test/java/org/elasticsearch/transport/netty/SimpleNettyTransportTests.java @@ -43,13 +43,8 @@ public class SimpleNettyTransportTests extends AbstractSimpleTransportTests { return transportService; } - @Test + @Test(expected = ConnectTransportException.class) public void testConnectException() { - try { - serviceA.connectToNode(new DiscoveryNode("C", new InetSocketTransportAddress("localhost", 9876), Version.CURRENT)); - fail(); - } catch (ConnectTransportException e) { - // all is well - } + serviceA.connectToNode(new DiscoveryNode("C", new InetSocketTransportAddress("localhost", 9876), Version.CURRENT)); } } \ No newline at end of file