GitService { @Path("add") @POST @Consumes(MediaType.APPLICATION_JSON) public void add(AddRequest request) throws ApiException { try (GitConnection gitConnection = getGitConnection()) { gitConnection.add(request); } }  @Path("add") @POST @Consumes(MediaType.APPLICATION_JSON) void add(AddRequest request); @Path("checkout") @POST @Consumes(MediaType.APPLICATION_JSON) void checkout(CheckoutRequest request); @Path("branch-create") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Branch branchCreate(BranchCreateRequest request); @Path("branch-delete") @POST @Consumes(MediaType.APPLICATION_JSON) void branchDelete(BranchDeleteRequest request); @Path("branch-rename") @POST void branchRename(@QueryParam("oldName") String oldName,
                             @QueryParam("newName") String newName); @Path("branch-list") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) GenericEntity<List<Branch>> branchList(BranchListRequest request); @Path("clone") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) RepoInfo clone(final CloneRequest request); @Path("commit") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) Revision commit(CommitRequest request); @Path("diff") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.TEXT_PLAIN) InfoPage diff(DiffRequest request); @Path("fetch") @POST @Consumes(MediaType.APPLICATION_JSON) void fetch(FetchRequest request); @Path("init") @POST @Consumes(MediaType.APPLICATION_JSON) void init(final InitRequest request); @Path("log") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) LogPage log(LogRequest request); @Path("merge") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) MergeResult merge(MergeRequest request); @Path("rebase") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) RebaseResponse rebase(RebaseRequest request); @Path("mv") @POST @Consumes(MediaType.APPLICATION_JSON) void mv(MoveRequest request); @Path("pull") @POST @Consumes(MediaType.APPLICATION_JSON) PullResponse pull(PullRequest request); @Path("push") @POST @Consumes(MediaType.APPLICATION_JSON) PushResponse push(PushRequest request); @Path("remote-add") @POST @Consumes(MediaType.APPLICATION_JSON) void remoteAdd(RemoteAddRequest request); @Path("remote-delete/{name}") @POST void remoteDelete(@PathParam("name") String name); @Path("remote-list") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) GenericEntity<List<Remote>> remoteList(RemoteListRequest request); @Path("remote-update") @POST @Consumes(MediaType.APPLICATION_JSON) void remoteUpdate(RemoteUpdateRequest request); @Path("reset") @POST @Consumes(MediaType.APPLICATION_JSON) void reset(ResetRequest request); @Path("rm") @POST @Consumes(MediaType.APPLICATION_JSON) void rm(RmRequest request); @Path("status") @POST @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) Status status(@QueryParam("format") StatusFormat format); @Path("tag-create") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Tag tagCreate(TagCreateRequest request); @Path("tag-delete") @POST @Consumes(MediaType.APPLICATION_JSON) void tagDelete(TagDeleteRequest request); @Path("config") @GET @Produces(MediaType.APPLICATION_JSON) Map<String, String> getConfig(@QueryParam("requestedConfig") List<String> requestedConfig); @Path("config") @PUT @Consumes(MediaType.APPLICATION_JSON) void setConfig(ConfigRequest request); @Path("config") @DELETE void unsetConfig(@QueryParam("requestedConfig") List<String> requestedConfig); @Path("tag-list") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) GenericEntity<List<Tag>> tagList(TagListRequest request); @Path("read-only-url") @Produces(MediaType.TEXT_PLAIN) @GET String readOnlyGitUrlTextPlain(@Context UriInfo uriInfo); @Path("import-source-descriptor") @Produces(MediaType.APPLICATION_JSON) @GET ImportSourceDescriptor importDescriptor(@Context UriInfo uriInfo); @GET @Path("commiters") Commiters getCommiters(@Context UriInfo uriInfo); @GET @Path("delete-repository") void deleteRepository(@Context UriInfo uriInfo);  }
@Test public void shouldReturnStatus200OnGetConfigWithNoRequestedConfig() throws Exception { List<String> configList = new ArrayList<>(); configList.add("xxx.aaa=1"); configList.add("xxx.bbb=2"); when(config.getList()).thenReturn(configList); Response response = given(). when(). get(SERVICE_PATH + "/config?" + PROJECT_PATH_PARAM_NAME + "=/watt_il_test_new"); assertEquals(response.getStatusCode(), 200); String expectedString1 = "\"xxx.aaa\":\"1\""; String expectedString2 = "\"xxx.bbb\":\"2\""; assertThat(response.getBody().asString(), containsString(expectedString1)); assertThat(response.getBody().asString(), containsString(expectedString2)); }