Commit f22d0c7d authored by Jorge Cordoba's avatar Jorge Cordoba Committed by Stephane Nicoll

Add missing assertion to SampleTestApplicationWebIntegrationTests.test()

See gh-19326
parent e5303ab7
...@@ -29,14 +29,17 @@ import org.springframework.boot.test.context.SpringBootTest; ...@@ -29,14 +29,17 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.BDDMockito.given; import static org.mockito.BDDMockito.given;
/** /**
* {@code @SpringBootTest} with a random port for {@link SampleTestApplication}. * {@code @SpringBootTest} with a random port for {@link SampleTestApplication}.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Jorge Cordoba
*/ */
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
...@@ -58,7 +61,8 @@ public class SampleTestApplicationWebIntegrationTests { ...@@ -58,7 +61,8 @@ public class SampleTestApplicationWebIntegrationTests {
@Test @Test
public void test() { public void test() {
this.restTemplate.getForEntity("/{username}/vehicle", String.class, "sframework"); assertThat(this.restTemplate.getForEntity("/{username}/vehicle", String.class, "sframework")
.getStatusCode()).isEqualTo(HttpStatus.OK);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment