You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by "kirklund (GitHub)" <gi...@apache.org> on 2018/11/05 18:43:16 UTC
[GitHub] [geode] kirklund commented on pull request #2654: Geode
5793: LocatorDUnitTest. testNonSSLLocatorDiesWhenConnectingToSSLLocator
Does "getConnectedDistributedSystem" actually throw GemFireConfigException? If this test doesn't need that "catch (GemFireConfigException" then delete it. If this test is actually verifying that GemFireConfigException should be thrown then it needs some more help.
Either add a fail statement in just before the catch so the test fails if the expected exception is not thrown. Or rewrite the block to use catchThrowable:
```
import static org.assertj.core.api.Assertions.catchThrowable;
Throwable thrown = catchThrowable(() -> getConnectedDistributedSystem(props));
assertThat(thrown).isInstanceOf(GemFireConfigException.class).hasMessageContaining("Rejecting findCoordinatorRequest");
```
Lines like "vm.invoke(LocatorDUnitTest::stopLocator);" would typically be better in a tearDown() method rather than a finally block.
[ Full content available at: https://github.com/apache/geode/pull/2654 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org