|
43 | 43 | import org.quartz.TriggerKey;
|
44 | 44 | import org.quartz.impl.matchers.GroupMatcher;
|
45 | 45 |
|
46 |
| -import org.springframework.boot.actuate.endpoint.ApiVersion; |
47 | 46 | import org.springframework.boot.actuate.endpoint.Show;
|
48 | 47 | import org.springframework.boot.actuate.endpoint.web.test.WebEndpointTest;
|
49 | 48 | import org.springframework.context.annotation.Bean;
|
|
65 | 64 | */
|
66 | 65 | class QuartzEndpointWebIntegrationTests {
|
67 | 66 |
|
68 |
| - private static final String V2_JSON = ApiVersion.V2.getProducedMimeType().toString(); |
69 |
| - |
70 |
| - private static final String V3_JSON = ApiVersion.V3.getProducedMimeType().toString(); |
71 |
| - |
72 | 67 | private static final JobDetail jobOne = JobBuilder.newJob(Job.class)
|
73 | 68 | .withIdentity("jobOne", "samples")
|
74 | 69 | .usingJobData(new JobDataMap(Collections.singletonMap("name", "test")))
|
@@ -261,49 +256,6 @@ void quartzTriggerJob(WebTestClient client) {
|
261 | 256 | client.post()
|
262 | 257 | .uri("/actuator/quartz/jobs/samples/jobOne")
|
263 | 258 | .contentType(MediaType.APPLICATION_JSON)
|
264 |
| - .accept(MediaType.APPLICATION_JSON) |
265 |
| - .bodyValue(Map.of("state", "running")) |
266 |
| - .exchange() |
267 |
| - .expectStatus() |
268 |
| - .isOk() |
269 |
| - .expectBody() |
270 |
| - .jsonPath("group") |
271 |
| - .isEqualTo("samples") |
272 |
| - .jsonPath("name") |
273 |
| - .isEqualTo("jobOne") |
274 |
| - .jsonPath("className") |
275 |
| - .isEqualTo("org.quartz.Job") |
276 |
| - .jsonPath("triggerTime") |
277 |
| - .isNotEmpty(); |
278 |
| - } |
279 |
| - |
280 |
| - @WebEndpointTest |
281 |
| - void quartzTriggerJobV2(WebTestClient client) { |
282 |
| - client.post() |
283 |
| - .uri("/actuator/quartz/jobs/samples/jobOne") |
284 |
| - .contentType(MediaType.parseMediaType(V2_JSON)) |
285 |
| - .accept(MediaType.APPLICATION_JSON) |
286 |
| - .bodyValue(Map.of("state", "running")) |
287 |
| - .exchange() |
288 |
| - .expectStatus() |
289 |
| - .isOk() |
290 |
| - .expectBody() |
291 |
| - .jsonPath("group") |
292 |
| - .isEqualTo("samples") |
293 |
| - .jsonPath("name") |
294 |
| - .isEqualTo("jobOne") |
295 |
| - .jsonPath("className") |
296 |
| - .isEqualTo("org.quartz.Job") |
297 |
| - .jsonPath("triggerTime") |
298 |
| - .isNotEmpty(); |
299 |
| - } |
300 |
| - |
301 |
| - @WebEndpointTest |
302 |
| - void quartzTriggerJobV3(WebTestClient client) { |
303 |
| - client.post() |
304 |
| - .uri("/actuator/quartz/jobs/samples/jobOne") |
305 |
| - .contentType(MediaType.parseMediaType(V3_JSON)) |
306 |
| - .accept(MediaType.APPLICATION_JSON) |
307 | 259 | .bodyValue(Map.of("state", "running"))
|
308 | 260 | .exchange()
|
309 | 261 | .expectStatus()
|
@@ -334,8 +286,7 @@ void quartzTriggerJobWithUnknownJobKey(WebTestClient client) {
|
334 | 286 | void quartzTriggerJobWithUnknownState(WebTestClient client) {
|
335 | 287 | client.post()
|
336 | 288 | .uri("/actuator/quartz/jobs/samples/jobOne")
|
337 |
| - .contentType(MediaType.parseMediaType(V3_JSON)) |
338 |
| - .accept(MediaType.APPLICATION_JSON) |
| 289 | + .contentType(MediaType.APPLICATION_JSON) |
339 | 290 | .bodyValue(Map.of("state", "unknown"))
|
340 | 291 | .exchange()
|
341 | 292 | .expectStatus()
|
|
0 commit comments