Minor cleanup
This commit is contained in:
parent
3385b72fb5
commit
73e3e356fa
5 changed files with 56 additions and 47 deletions
|
@ -1,7 +1,6 @@
|
|||
package com.example.springboot;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||
|
@ -11,17 +10,16 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
public class HelloControllerIT {
|
||||
@Autowired
|
||||
private TestRestTemplate template;
|
||||
|
||||
@Autowired
|
||||
private TestRestTemplate template;
|
||||
public static void main(String[] args) throws Exception {
|
||||
new HelloControllerIT().getHello();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getHello() throws Exception {
|
||||
ResponseEntity<String> response = template.getForEntity("/", String.class);
|
||||
assertThat(response.getBody()).isEqualTo("Greetings from Spring Boot!");
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
new HelloControllerIT().getHello();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue