Merge pull request #19326 from jcordoba95

* pr/19326:
  Polish contribution
  Add missing assertion to SampleTestApplicationWebIntegrationTests.test()

Closes gh-19326
This commit is contained in:
Stephane Nicoll 2019-12-12 16:47:08 +01:00
commit bf397412e6

View File

@ -29,14 +29,17 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.test.context.junit4.SpringRunner;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.BDDMockito.given;
/**
* {@code @SpringBootTest} with a random port for {@link SampleTestApplication}.
*
* @author Phillip Webb
* @author Jorge Cordoba
*/
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@ -58,7 +61,8 @@ public class SampleTestApplicationWebIntegrationTests {
@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);
}
}