I have a spring-boot app with controller that uses Pageable as an argument to one of its methods. It works fine. But I want to use spring-contract-verifier to generate and execute tests. Base class for tests looks like this:
public class MvcTest {
@Before
public void setup() {
RestAssuredMockMvc.standaloneSetup(new Controller());
}
}
The exception I'm getting is:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.domain.Pageable]: Specified class is an interface
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:99)
I searched SO and I found out that I should add
@EnableSpringDataWebSupport
to my configuration class. I created a class:
@Configuration
@EnableWebMvc
@EnableSpringDataWebSupport
public class WebConfig {
}
However, I'm not sure how to tell contract verifier to pull this class into configuration. Thanks
Its the wrong pagable: use org.springframework.data.domain.Pageable instead of java.awt.print.Pageable.
you need to enable
@EnableSpringDataWebSupport
or
<bean class="org.springframework.data.web.config.SpringDataWebConfiguration" />
@see: http://docs.spring.io/spring-data/jpa/docs/current/reference/html/#core.web
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With