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