.setKey(LockKey.job(new JobKey("role", "env", "name")))
.setToken("token");
SessionKey session = new SessionKey()
.setData("session data".getBytes(StandardCharsets.UTF_8))
.setMechanism("fake");
Response response = new Response()
.setResponseCode(OK);
JobConfiguration job = JOB_CONFIG.newBuilder();
expect(thrift.createJob(job, lock, session)).andReturn(response);
replayAndStart();
Response actualResponse = getRequestBuilder("/apibeta/createJob")
.entity(
ImmutableMap.of("description", job, "lock", lock, "session", session),
MediaType.APPLICATION_JSON)
.post(Response.class);
assertEquals(response, actualResponse);