DefaultProvider implements Provider { @Override public PluginSettings pluginSettings(Map<String, String> responseBodyMap) { return new DefaultPluginSettings( responseBodyMap.get(PLUGIN_SETTINGS_SERVER_BASE_URL), responseBodyMap.get(PLUGIN_SETTINGS_END_POINT), responseBodyMap.get(PLUGIN_SETTINGS_USERNAME), responseBodyMap.get(PLUGIN_SETTINGS_PASSWORD), responseBodyMap.get(PLUGIN_SETTINGS_OAUTH_TOKEN) ); } DefaultProvider(PluginConfigurationView pluginConfigurationView); @Override PluginConfigurationView configurationView(); @Override PluginSettings pluginSettings(Map<String, String> responseBodyMap);  }
@Test public void shouldReturnSettingsObject() { Map<String, String> responseBodyMap = new HashMap<String, String>(); responseBodyMap.put(PLUGIN_SETTINGS_SERVER_BASE_URL, "url"); responseBodyMap.put(PLUGIN_SETTINGS_END_POINT, "endpoint"); responseBodyMap.put(PLUGIN_SETTINGS_USERNAME, "username"); responseBodyMap.put(PLUGIN_SETTINGS_PASSWORD, "password"); responseBodyMap.put(PLUGIN_SETTINGS_OAUTH_TOKEN, "token"); PluginSettings pluginSettings = provider.pluginSettings(responseBodyMap); assertThat(pluginSettings.getServerBaseURL(), is("url")); assertThat(pluginSettings.getEndPoint(), is("endpoint")); assertThat(pluginSettings.getUsername(), is("username")); assertThat(pluginSettings.getPassword(), is("password")); assertThat(pluginSettings.getOauthToken(), is("token")); }