@Test public void listStatuses() throws Exception { mockServer.expect(requestTo("https: .andExpect(method(HttpMethod.GET)) .andRespond(withSuccess(jsonResource("statusList"), APPLICATION_JSON)); List<Status> statusList = statusesTemplate.listStatuses("zalando-stups", "blub", "abcdefgh1234567"); Assertions.assertThat(statusList).isNotNull(); Assertions.assertThat(statusList.size()).isEqualTo(1); Assertions.assertThat(statusList.get(0).getId()).isEqualTo(1); }
@Override public List<Status> listStatuses(String owner, String repository,String ref) { Map<String, Object> uriVariables = new HashMap<>(); uriVariables.put("owner", owner); uriVariables.put("repository", repository); uriVariables.put("ref", ref); return getRestOperations().exchange(buildUri("/repos/{owner}/{repository}/commits/{ref}/statuses", uriVariables), HttpMethod.GET, null, statusListTypeRef).getBody(); }
StatusesTemplate extends AbstractGithubTemplate implements StatusesOperations { @Override public List<Status> listStatuses(String owner, String repository,String ref) { Map<String, Object> uriVariables = new HashMap<>(); uriVariables.put("owner", owner); uriVariables.put("repository", repository); uriVariables.put("ref", ref); return getRestOperations().exchange(buildUri("/repos/{owner}/{repository}/commits/{ref}/statuses", uriVariables), HttpMethod.GET, null, statusListTypeRef).getBody(); } }
StatusesTemplate extends AbstractGithubTemplate implements StatusesOperations { @Override public List<Status> listStatuses(String owner, String repository,String ref) { Map<String, Object> uriVariables = new HashMap<>(); uriVariables.put("owner", owner); uriVariables.put("repository", repository); uriVariables.put("ref", ref); return getRestOperations().exchange(buildUri("/repos/{owner}/{repository}/commits/{ref}/statuses", uriVariables), HttpMethod.GET, null, statusListTypeRef).getBody(); } StatusesTemplate(RestOperations restOperations); }
StatusesTemplate extends AbstractGithubTemplate implements StatusesOperations { @Override public List<Status> listStatuses(String owner, String repository,String ref) { Map<String, Object> uriVariables = new HashMap<>(); uriVariables.put("owner", owner); uriVariables.put("repository", repository); uriVariables.put("ref", ref); return getRestOperations().exchange(buildUri("/repos/{owner}/{repository}/commits/{ref}/statuses", uriVariables), HttpMethod.GET, null, statusListTypeRef).getBody(); } StatusesTemplate(RestOperations restOperations); @Override Status createStatus(String owner, String repository, String sha, StatusRequest body); @Override List<Status> listStatuses(String owner, String repository,String ref); @Override CombinedStatus getCombinedStatus(String owner, String repository, String ref); }
StatusesTemplate extends AbstractGithubTemplate implements StatusesOperations { @Override public List<Status> listStatuses(String owner, String repository,String ref) { Map<String, Object> uriVariables = new HashMap<>(); uriVariables.put("owner", owner); uriVariables.put("repository", repository); uriVariables.put("ref", ref); return getRestOperations().exchange(buildUri("/repos/{owner}/{repository}/commits/{ref}/statuses", uriVariables), HttpMethod.GET, null, statusListTypeRef).getBody(); } StatusesTemplate(RestOperations restOperations); @Override Status createStatus(String owner, String repository, String sha, StatusRequest body); @Override List<Status> listStatuses(String owner, String repository,String ref); @Override CombinedStatus getCombinedStatus(String owner, String repository, String ref);  }