Springboot-web test configuration

  java, springboot

Configuration

@WebIntegrationTest(randomPort = true)

Can be replaced

@IntegrationTest(“server.port:0”)
@WebAppConfiguration

Complete instance

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = DemoApplication.class)
@WebIntegrationTest
@ActiveProfiles("local")

docs