@Test public void shouldLoginWithUserPassButThenFallbackToApiKeyMode() throws Exception { Properties properties = new Properties(); properties.load(new FileInputStream(VALID_CONF_FILE_LOCATION)); String user = (String) properties.get("username"); String password = (String) properties.get("password"); janbanery = janbaneryFactory.connectUsing(user, password).toWorkspace(EXISTING_WORKSPACE); AuthProvider usedAuthProvider = janbanery.getAuthMode(); assertThat(usedAuthProvider).isInstanceOf(ApiKeyAuthProvider.class); }
public JanbaneryToWorkspace connectUsing(Configuration configuration) { RestClient restClient = getRestClient(configuration); return new JanbaneryToWorkspace(new Janbanery(configuration, restClient)); }
JanbaneryFactory { public JanbaneryToWorkspace connectUsing(Configuration configuration) { RestClient restClient = getRestClient(configuration); return new JanbaneryToWorkspace(new Janbanery(configuration, restClient)); } }
JanbaneryFactory { public JanbaneryToWorkspace connectUsing(Configuration configuration) { RestClient restClient = getRestClient(configuration); return new JanbaneryToWorkspace(new Janbanery(configuration, restClient)); } JanbaneryFactory();  JanbaneryFactory(AsyncHttpClient asyncHttpClient);  JanbaneryFactory(RestClient restClient); }
JanbaneryFactory { public JanbaneryToWorkspace connectUsing(Configuration configuration) { RestClient restClient = getRestClient(configuration); return new JanbaneryToWorkspace(new Janbanery(configuration, restClient)); } JanbaneryFactory();  JanbaneryFactory(AsyncHttpClient asyncHttpClient);  JanbaneryFactory(RestClient restClient); JanbaneryToWorkspace connectUsing(Configuration configuration); JanbaneryToWorkspace connectUsing(String apiKey); JanbaneryToWorkspace connectUsing(String user, String password); Janbanery connectAndKeepUsing(String user, String password); void setAsyncHttpClient(AsyncHttpClient asyncHttpClient); void setEncodedBodyGenerator(ReflectionBodyGenerator encodedBodyGenerator); void setGson(Gson gson); }
JanbaneryFactory { public JanbaneryToWorkspace connectUsing(Configuration configuration) { RestClient restClient = getRestClient(configuration); return new JanbaneryToWorkspace(new Janbanery(configuration, restClient)); } JanbaneryFactory();  JanbaneryFactory(AsyncHttpClient asyncHttpClient);  JanbaneryFactory(RestClient restClient); JanbaneryToWorkspace connectUsing(Configuration configuration); JanbaneryToWorkspace connectUsing(String apiKey); JanbaneryToWorkspace connectUsing(String user, String password); Janbanery connectAndKeepUsing(String user, String password); void setAsyncHttpClient(AsyncHttpClient asyncHttpClient); void setEncodedBodyGenerator(ReflectionBodyGenerator encodedBodyGenerator); void setGson(Gson gson);  }