+ @After
+ public void tearDown() {
+ core.stopAndWait();
+ }
+
+ @Test
+ public void startingTheCoreWithAnEmptyNetworkStartsButDoesNotConnect() {
+ Network firstNetwork = Network.builder("FirstNet").build();
+ Channel firstChannel = new Channel(firstNetwork, "#first");
+ core.addChannel(firstChannel);
+ core.startAndWait();
+ ArgumentCaptor<Object> eventCaptor = ArgumentCaptor.forClass(Object.class);
+ verify(eventBus, times(2)).post(eventCaptor.capture());
+ assertThat(eventCaptor.getAllValues(), containsInAnyOrder(
+ instanceOf(GenericError.class), instanceOf(CoreStarted.class)
+ ));
+ verify(connectionFactory, never()).createConnection(anyString(), anyInt());
+ }
+