mercredi 27 février 2019

Test static content with MockMVC in Spring Boot with Slice

I'm trying to figure out a way to test with MockMVC the serving of content using a WebSlice that only autoconfigs org.springframework.web.servlet.resource.ResourceHttpRequestHandler (and not controllers)

i've tried something like this:

@RunWith(SpringRunner.class)
@WebMvcTest(
    controllers = {}
)
public class StaticAssetsMVCTest {

but {} is the default and it looks for all controllers. Is there a way to exclude all controllers but keep the other basic spring-web things my app has so that i can test just the static assets slices?

Aucun commentaire:

Enregistrer un commentaire