Ensure that logfile endpoint documentation has some log entries to use
Closes gh-5848
This commit is contained in:
parent
6f4ec4e741
commit
f8a4459aa1
|
|
@ -21,7 +21,7 @@
|
|||
<!-- Provided -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-actuator</artifactId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import java.util.Map;
|
|||
|
||||
import groovy.text.Template;
|
||||
import groovy.text.TemplateEngine;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
|
|
@ -60,7 +61,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
|||
"endpoints.health.sensitive=true", "endpoints.actuator.enabled=false" })
|
||||
@DirtiesContext
|
||||
@AutoConfigureRestDocs(EndpointDocumentation.RESTDOCS_OUTPUT_DIR)
|
||||
@AutoConfigureMockMvc
|
||||
@AutoConfigureMockMvc(alwaysPrint = false)
|
||||
public class EndpointDocumentation {
|
||||
|
||||
static final String RESTDOCS_OUTPUT_DIR = "target/generated-snippets";
|
||||
|
|
@ -74,6 +75,11 @@ public class EndpointDocumentation {
|
|||
@Autowired
|
||||
private MockMvc mockMvc;
|
||||
|
||||
@BeforeClass
|
||||
public static void clearLog() {
|
||||
new File("target/logs/spring.log").delete();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void logfile() throws Exception {
|
||||
this.mockMvc.perform(get("/logfile").accept(MediaType.TEXT_PLAIN))
|
||||
|
|
|
|||
Loading…
Reference in New Issue