// Tests_SRS_AMQPSIOTHUBCONNECTIONBASEHANDLER_14_037: [If the Connection and Session (Proton) are // not opened before a constant number of seconds, this handler will inform the // AmqpsIotHubConnection that the Connection was not opened in time.] @Test(expected = ExecutionException.class) public void onConnectionLocalOpenTimesOut() throws ExecutionException, InterruptedException { final String hostName = "test.host.name"; final String deviceId = "test-deviceId"; final String userName = "******"; final String sasToken = "test-token"; AmqpsIotHubConnectionBaseHandler handler = new AmqpsIotHubConnectionBaseHandler( hostName, userName, sasToken, deviceId, mockIotHubConnection); Deencapsulation.setField( mockIotHubConnection, "reactorReady", new CompletableFuture<Boolean>()); handler.onConnectionLocalOpen(mockEvent); CompletableFuture<Boolean> future = Deencapsulation.getField(mockIotHubConnection, "reactorReady"); future.get(); }