LoggingSession implements InternalSessionContext { public synchronized void createSession(final LogConfigSupplier logConfigSupplier) { createSession(logConfigSupplier, true, true); } LoggingSession(final Configuration configuration,
      final LoggingSessionNotifier loggingSessionNotifier); static LoggingSession create(); synchronized void createSession(final LogConfigSupplier logConfigSupplier); synchronized void createSession(final LogConfigSupplier logConfigSupplier,
      final boolean logBanner, final boolean logConfiguration); synchronized void createSession(final LogConfigSupplier logConfigSupplier,
      final boolean logBanner, final boolean logConfiguration,
      final boolean standardOutputAlwaysOn); synchronized void startSession(); synchronized void stopSession(); synchronized void shutdown(); Optional<LogFile> getLogFile(); @Override State getState(); @Override LogConfigSupplier getLogConfigSupplier();  }
@Test public void createSessionInitializesConfiguration() { loggingSession.createSession(logConfigSupplier); verify(configuration).initialize(eq(logConfigSupplier)); }
@Test public void createSessionInvokesConfigChangedOnConfiguration() { loggingSession.createSession(logConfigSupplier); verify(configuration).configChanged(); }
@Test public void createSessionPublishesConfigBeforeCreatingLoggingSession() { loggingSession.createSession(logConfigSupplier); InOrder inOrder = inOrder(configuration, loggingSessionNotifier); inOrder.verify(configuration).initialize(eq(logConfigSupplier)); inOrder.verify(configuration).configChanged(); inOrder.verify(loggingSessionNotifier).createSession(eq(loggingSession)); inOrder.verifyNoMoreInteractions(); }
@Test public void createSessionNotifiesLoggingSessionListeners() { loggingSession.createSession(logConfigSupplier); verify(loggingSessionNotifier).createSession(eq(loggingSession)); }
@Test public void createSessionThrowsIfSessionAlreadyCreated() { loggingSession.createSession(logConfigSupplier); assertThatThrownBy(() -> loggingSession.createSession(logConfigSupplier)) .isInstanceOf(IllegalStateException.class); }