ClientDelegator extends BaseDelegator implements IClientDelegator { private static void replaceWithUnderscoreIfClientNameContainsWhitespacesOrTabs(IClient newClient) { final String TABS = "\t"; String name = newClient.getName(); if (containsAny(name, SPACE, TABS)) { String newClientName = replacePattern(name, "\\s", "_"); newClient.setName(newClientName); } } ClientDelegator(IOptionsServer server); @Override IClient getClient(final String clientName); @Override IClient getClient(@Nonnull IClientSummary clientSummary); @Override IClient getClientTemplate(String clientName); @Override IClient getClientTemplate(final String clientName, final boolean allowExistent); @Override IClient getClientTemplate(
			@Nonnull String clientName,
			GetClientTemplateOptions getClientTemplateOptions); @Override String createClient(@Nonnull final IClient newClient); @Override void createTempClient(@Nonnull final IClient newClient); @Override String updateClient(@Nonnull final IClient client); @Override String updateClient(@Nonnull final IClient client, final boolean force); @Override String updateClient(@Nonnull final IClient client, final UpdateClientOptions opts); @Override String deleteClient(final String clientName, final boolean force); @Override String deleteClient(final String clientName, final DeleteClientOptions opts); String switchClientView(final String templateClientName,
								   final String targetClientName,
								   final SwitchClientViewOptions opts); @Override String switchStreamView(final String streamPath,
								   final String targetClientName,
								   final SwitchClientViewOptions opts);  }
@Test public void replaceWithUnderscoreIfClientNameContainsWhitespacesOrTabs() throws Exception { Method method = getPrivateMethod(ClientDelegator.class, "replaceWithUnderscoreIfClientNameContainsWhitespacesOrTabs", IClient.class); String clientNameWithWhitespace = "my client\t\tname"; String expectNewClientName = "my_client__name"; mockClient = mock(IClient.class); when(mockClient.getName()).thenReturn(clientNameWithWhitespace); method.invoke(clientDelegator, mockClient); verify(mockClient).setName(expectNewClientName); }