Made tests less brittle - fixed the stupid change

This commit is contained in:
Marcin Grzejszczak
2016-12-16 13:36:43 +01:00
parent 765e41d6c7
commit f047b39fd8

View File

@@ -20,22 +20,22 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.boot.test.WebIntegrationTest;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.cloud.sleuth.util.ExceptionUtils;
import org.springframework.core.env.Environment;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.web.client.RestTemplate;
import static org.assertj.core.api.BDDAssertions.then;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Issue469.class)
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Issue469.class,
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@TestPropertySource(properties = {"spring.mvc.view.prefix=/WEB-INF/jsp/",
"spring.mvc.view.suffix=.jsp"})
@WebIntegrationTest({ "server.port=0" })
public class Issue469Tests {
@Autowired Tracer tracer;
@@ -54,7 +54,7 @@ public class Issue469Tests {
.getForObject("http://localhost:" + port() + "/welcome", String.class);
} catch (Exception e) {
// JSPs are not rendered
then(e).hasMessage("404");
then(e).hasMessageContaining("404");
}
then(ExceptionUtils.getLastException()).isNull();