Spring REST Docs reference guides to setting up MockMvc using autowired ApplicationContext
:
@Before
public void setUp() {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context)
.apply(documentationConfiguration(this.restDocumentation))
.alwaysDo(document("{method-name}/{step}/")).build();
}
and in this blog it is described how to use static @Configuration
classes.
However using such a static class the autowired context is not the context created from this class. It seems this class is ignored.
Is there a way to combine these two?