StashProvider extends DefaultProvider { @Override public void updateStatus(String url, PluginSettings pluginSettings, String branch, String revision, String pipelineStage, String result, String trackbackURL) throws Exception { String endPointToUse = pluginSettings.getEndPoint(); String usernameToUse = pluginSettings.getUsername(); String passwordToUse = pluginSettings.getPassword(); if (StringUtils.isEmpty(endPointToUse)) { endPointToUse = System.getProperty("go.plugin.build.status.stash.endpoint"); } if (StringUtils.isEmpty(usernameToUse)) { usernameToUse = System.getProperty("go.plugin.build.status.stash.username"); } if (StringUtils.isEmpty(passwordToUse)) { passwordToUse = System.getProperty("go.plugin.build.status.stash.password"); } String updateURL = String.format("%s/rest/build-status/1.0/commits/%s", endPointToUse, revision); Map<String, String> params = new HashMap<String, String>(); params.put("state", getState(result)); params.put("key", pipelineStage); params.put("name", pipelineStage); params.put("url", trackbackURL); params.put("description", ""); String requestBody = new GsonBuilder().create().toJson(params); httpClient.postRequest(updateURL, AuthenticationType.BASIC, usernameToUse, passwordToUse, requestBody); } StashProvider();  StashProvider(HTTPClient httpClient); @Override String pluginId(); @Override String pollerPluginId(); @Override void updateStatus(String url, PluginSettings pluginSettings, String branch, String revision, String pipelineStage,
                             String result, String trackbackURL); @Override List<Map<String, Object>> validateConfig(Map<String, Object> fields); String getState(String result); static final String PLUGIN_ID; static final String STASH_PR_POLLER_PLUGIN_ID; static final String IN_PROGRESS_STATE; static final String SUCCESSFUL_STATE; static final String FAILED_STATE; }
@Ignore("for local runs") @Test public void shouldUpdateStatusForPR() throws Exception { provider.updateStatus("http: }