java-tutorials/spring-vertx/src/test/java/com/baeldung/vertxspring/VertxSpringApplicationIntegrationTest.java
Grzegorz Piwowarek fe11e8f7d4 Idiomatic refactor (#2063)
* StringToCharStream

* Spring integration tests

* Spring integration tests
2017-06-13 16:54:45 +02:00

28 lines
876 B
Java

package com.baeldung.vertxspring;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
public class VertxSpringApplicationIntegrationTest {
private TestRestTemplate restTemplate = new TestRestTemplate();
@Test
public void givenUrl_whenReceivedArticles_thenSuccess() throws InterruptedException {
ResponseEntity<String> responseEntity = restTemplate.getForEntity("http://localhost:8080/api/baeldung/articles", String.class);
assertEquals(200, responseEntity.getStatusCodeValue());
}
}