25 lines
778 B
Java
25 lines
778 B
Java
package com.baeldung;
|
|
|
|
import org.junit.Test;
|
|
import org.junit.runner.RunWith;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
import org.springframework.boot.web.server.LocalServerPort;
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
@RunWith(SpringRunner.class)
|
|
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
|
public class NotificationApplicationIntegrationTest {
|
|
|
|
@LocalServerPort
|
|
private int port;
|
|
|
|
@Test
|
|
public void givenAppStarted_whenNotificationTasksSubmitted_thenProcessed() {
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
restTemplate.getForObject("http://localhost:" + port + "/startNotification/10", String.class);
|
|
}
|
|
|
|
|
|
}
|