@Test public void it_does_not_attempt_to_create_environments_with_null_or_empty_tokens() { classUnderTest.initialize(new String[] {"token1", null, ""}); verify(logEntriesFactory).createLogger("token1", context); verify(logEntriesFactory, never()).createLogger(null, context); verify(logEntriesFactory, never()).createLogger("", context); }
public VialerLogger initialize(String[] logTokens) { for (String logToken : logTokens) { addLoggingEnvironment(logToken); } return this; }
VialerLogger { public VialerLogger initialize(String[] logTokens) { for (String logToken : logTokens) { addLoggingEnvironment(logToken); } return this; } }
VialerLogger { public VialerLogger initialize(String[] logTokens) { for (String logToken : logTokens) { addLoggingEnvironment(logToken); } return this; } VialerLogger(Context context, LogEntriesFactory logEntriesFactory); }
VialerLogger { public VialerLogger initialize(String[] logTokens) { for (String logToken : logTokens) { addLoggingEnvironment(logToken); } return this; } VialerLogger(Context context, LogEntriesFactory logEntriesFactory); VialerLogger initialize(String[] logTokens); void log(String message); void addLoggingEnvironment(String token); void logToEnvironment(String token, String message); }
VialerLogger { public VialerLogger initialize(String[] logTokens) { for (String logToken : logTokens) { addLoggingEnvironment(logToken); } return this; } VialerLogger(Context context, LogEntriesFactory logEntriesFactory); VialerLogger initialize(String[] logTokens); void log(String message); void addLoggingEnvironment(String token); void logToEnvironment(String token, String message);  }