We have a Spring application, building with Gradle, running with Spring Boot 1.2.5.RELEASE. We wrote some initial integration tests using using Rest Assured to test against our REST endpoints. This worked, and our application's REST endpoints were responding appropriately via the browser and Postman.
Then we used Spring Security to implement a OncePerRequestFilter and our own AuthenticationProvider. Our authentication is working fine, and the browser and Postman are still receiving appropriate responses, however our integration tests no longer work.
Stepping through a test, we do see our Controller endpoints being called and returning the correct output, but beyond this point we receive error (with a null stacktrack) of org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.AbstractMethodError.
We've made progress by initializing our integration tests with Spring Security, we've tried abandoning Rest Assured and just using MockMvc, we've tried going back to Rest Assured and initializing with MockMvc. No luck so far.
Our initialization code is below, the commented out portions are for Rest Assured, the current implementation is directly using MockMvc.
Any help would be greatly appreciated!
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = IamExtensionApplication.class)
@WebIntegrationTest
public class OurIntegrationTest {
private MockMvc mockMvc;
@Autowired
private WebApplicationContext webApplicationContext;
// @Autowired
// private FilterChainProxy filterChainProxy;
@Before
public void setUp() {
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).
apply(springSecurity()).
// addFilters(filterChainProxy).
build();
// RestAssuredMockMvc.mockMvc(mockMvc);
}
@Test
public void our_test() {
try {
ResultActions resp = amockMvc.perform(post("/our/endpoint").param("test", "test_value"));
} catch (Exception e) {
e.printStackTrace();
}
// MockMvcResponse resp = given()
// .param("test", "test_value")
// .when()
// .post("/our/endpoint");
}