Skip to content

Commit 5f9410d

Browse files
committed
test: Remove Jackson dependency from petclinic fixture
The upstream spring-framework-petclinic project changed Jackson coordinates from com.fasterxml.jackson to tools.jackson.core, breaking our custom ShowAvailable controller in petclinic-fw tests. Replaced ObjectMapper with manual JSON formatting and removed the now-unused Result inner class, making the test fixture resilient to upstream dependency changes.
1 parent b177456 commit 5f9410d

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

  • agent/src/test/fixture/shared/src/main/java/org/springframework/samples/petclinic/web
Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,19 @@
11
package org.springframework.samples.petclinic.web;
22

3-
import java.io.IOException;
4-
53
import org.springframework.web.bind.annotation.PostMapping;
64
import org.springframework.web.bind.annotation.RequestBody;
75
import org.springframework.web.bind.annotation.RestController;
86

9-
import com.fasterxml.jackson.databind.ObjectMapper;
10-
117
/**
128
* ShowAvailable is a simple Spring Controller that simply returns the number
139
* of bytes available in the request's InputStream.
1410
*/
1511
@RestController
1612
public class ShowAvailable {
17-
private static class Result {
18-
private final int available;
19-
20-
public Result(int available) {
21-
this.available = available;
22-
}
23-
24-
public String getAvailable() {
25-
return Integer.toString(available);
26-
}
27-
}
2813

2914
@PostMapping("/showavailable")
3015
public String doPost(@RequestBody String body) throws Exception {
31-
return new ObjectMapper().writeValueAsString(new Result(body.length()));
16+
return String.format("{\"available\":\"%d\"}", body.length());
3217
}
3318

3419
}

0 commit comments

Comments
 (0)