packagecom.example.demo;importorg.junit.jupiter.api.Test;importorg.springframework.boot.test.context.SpringBootTest;importorg.springframework.boot.test.context.SpringBootTest.WebEnvironment;importorg.springframework.boot.test.web.client.TestRestTemplate;importorg.springframework.beans.factory.annotation.Autowired;importstaticorg.junit.jupiter.api.Assertions.assertEquals;@SpringBootTest(webEnvironment=WebEnvironment.RANDOM_PORT)publicclassDemoApplicationTests{@TestpublicvoidcontextLoads(){}@AutowiredprivateTestRestTemplaterestTemplate;@TestpublicvoidhomeResponse(){Stringbody=this.restTemplate.getForObject("/",String.class);assertEquals("Spring is here!",body);}}