Category "mockmvc"

MockMVC - calling a PUT endpoint that accepts a multipart file

I have a simple PUT endpoint in a Spring Boot application: @PutMapping() public ResponseEntity<String> upload(@RequestParam("cats") MultipartFile file) th

Cannot deserialize value of type `java.lang.String` from Array value from mockmvc

public class ModelDTO implements Serializable { private Long id; private String datasetName; @JsonRawValue private String json; } Post API i

MockMvc Error: java.lang.NoSuchFieldError: defaultInstance

I am trying to write some integration tests in my spring application. POM: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.

How to avoid jwt token or ignore authentication when testing HTTP API request?

mvc.perform(MockMvcRequestBuilders.get("/PensionerDetailByAadhaar?aadhaarNumber=123").header("Authorization","Bearer "+token)).andExpect(status().isOk()); Here