Skip to content

Commit

Permalink
Merge pull request #19326 from jcordoba95
Browse files Browse the repository at this point in the history
* pr/19326:
  Polish contribution
  Add missing assertion to SampleTestApplicationWebIntegrationTests.test()

Closes gh-19326
  • Loading branch information
snicoll committed Dec 12, 2019
2 parents e5303ab + cd085e0 commit bf39741
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@
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)
Expand All @@ -58,7 +61,8 @@ public void setup() {

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

}

0 comments on commit bf39741

Please sign in to comment.