Add missing assertion to SampleTestApplicationWebIntegrationTests.test()

See gh-19326
pull/19372/head
Jorge Cordoba 5 years ago committed by Stephane Nicoll
parent e5303ab755
commit f22d0c7d8e

@ -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 {
@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);
} }
} }

Loading…
Cancel
Save