### Question:
MultipartConfig { @Bean public MultipartResolver multipartResolver() { return new StandardServletMultipartResolver() { @Override public boolean isMultipart(HttpServletRequest request) { String method = request.getMethod().toLowerCase(); if (!Arrays.asList("put", "post").contains(method)) { return false; } String contentType = request.getContentType(); return (contentType != null && contentType.toLowerCase().startsWith("multipart/")); } }; }  @Bean MultipartResolver multipartResolver();  }### Answer:
@Test void shouldDoPutRequestAndReturnTrue() { MockHttpServletRequest request = new MockHttpServletRequest("PUT", "/api/v1/"); request.setContentType("multipart/"); MultipartConfig multipartConfig = new MultipartConfig(); assertTrue(multipartConfig.multipartResolver().isMultipart(request)); }
@Test void shouldDoGetRequestAndReturnFalse() { MockHttpServletRequest request = new MockHttpServletRequest("GET", "/api/v1/"); request.setContentType("multipart/"); MultipartConfig multipartConfig = new MultipartConfig(); assertFalse(multipartConfig.multipartResolver().isMultipart(request)); }