Skip to content

Commit

Permalink
Make sure getJobStatus named consistently.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miles-Garnsey committed Sep 26, 2023
1 parent adb5d0c commit 3028d08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public synchronized void unregister() {
RpcRegistry.unregister(RPC_CLASS_NAME);
}

@Rpc(name = "jobStatus")
@Rpc(name = "getJobStatus")
public Map<String, String> getJobStatus(@RpcParam(name = "job_id") String jobId) {
Map<String, String> resultMap = new HashMap<>();
Job jobWithId = service.getJobWithId(jobId);
Expand Down Expand Up @@ -909,4 +909,4 @@ public Map<List<String>, List<String>> getRangeToEndpointMap(
@RpcParam(name = "keyspaceName") String keyspaceName) {
return ShimLoader.instance.get().getStorageService().getRangeToEndpointMap(keyspaceName);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ public Response getJobStatus(
Map<String, String> jobResponse =
(Map<String, String>)
ResponseTools.getSingleRowResponse(
app.dbUnixSocketFile, app.cqlService, "CALL NodeOps.jobStatus(?)", jobId);
app.dbUnixSocketFile, app.cqlService, "CALL NodeOps.getJobStatus(?)", jobId);
if (jobResponse.isEmpty()) {
return Response.status(Response.Status.NOT_FOUND).entity(jobResponse).build();
}
return Response.ok(jobResponse, MediaType.APPLICATION_JSON).build();
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ public void testJobStatus() throws Exception {

Assert.assertEquals(HttpStatus.SC_OK, response.getStatus());
verify(context.cqlService)
.executePreparedStatement(any(), eq("CALL NodeOps.jobStatus(?)"), anyString());
.executePreparedStatement(any(), eq("CALL NodeOps.getJobStatus(?)"), anyString());

String json = response.getContentAsString();

Expand Down Expand Up @@ -648,7 +648,7 @@ public void testJobStatusNotExisting() throws Exception {

Assert.assertEquals(HttpStatus.SC_NOT_FOUND, response.getStatus());
verify(context.cqlService)
.executePreparedStatement(any(), eq("CALL NodeOps.jobStatus(?)"), anyString());
.executePreparedStatement(any(), eq("CALL NodeOps.getJobStatus(?)"), anyString());

String json = response.getContentAsString();
assertEquals("{}", json);
Expand Down Expand Up @@ -2140,4 +2140,4 @@ public void testMoveAsync_MissingNewToken() throws Exception {
verify(context.cqlService, never())
.executePreparedStatement(any(), eq("CALL NodeOps.move(?, ?)"), eq("1234"), eq(true));
}
}
}

0 comments on commit 3028d08

Please sign in to comment.