Top "Spring-boot-test" questions

Set property with wiremock random port in spring boot test

I have a Spring Boot test that uses wiremock to mock an external service. In order to avoid conflicts with …

java spring-boot configuration wiremock spring-boot-test
SpringBootTest : No qualifying bean of type 'org.springframework.test.web.servlet.MockMvc' available:

Hey i have started learing spring-boot junit testing using spring boot Test framework at the time of creating the test …

java spring-boot junit4 spring-boot-test mockmvc
Testing a @KafkaListener using Spring Embedded Kafka

I am trying to write a unit test for a Kafka listener that I am developing using Spring Boot 2.x. …

java spring-boot apache-kafka spring-kafka spring-boot-test
Testing Log Output Java Spring

I have a spring boot 2 application running on java 10 using SLF4J and logback as the underlying logger. Given the …

java junit logback slf4j spring-boot-test
Spring boot and camel testing with @SpringBootTest

I have spring boot app, with spring boot of version 1.5.8 and there camel 2.20.1 Simple route : @Component public class MyRoute extends …

java spring-boot apache-camel spring-boot-test spring-camel
JUnit's @TestMethodOrder annotation not working

I'm having a problem with following integration test import org.junit.jupiter.api.Order; import org.junit.jupiter.api.TestMethodOrder; …

java spring-boot junit5 spring-boot-test
@Value("${local.server.port}") not working in Spring boot 1.5

I am upgrading Spring Boot from 1.3 to 1.5. For upgrading to 1.5 I have replaced @SpringApplicationConfiguration(classes = TestConfig.class) @WebIntegrationTest with @SpringBootTest(…

java spring spring-boot spring-boot-test
How to set active profile programmatically for any environment?

I want to set active profile host dependent for any envrionment and cannot find an environment independent hook. Following factory …

spring spring-mvc spring-boot spring-profiles spring-boot-test
SpringBootTest with MockMvcBuilders stand alone setup is not loading my ControllerAdvice despite setting it

I am creating my controller and controller advice like this: Test class: @RunWith(SpringRunner.class) @SpringBootTest public class TestController { private …

java spring spring-mvc spring-boot spring-boot-test