Commit 6e16d4fc authored by Fabio Busatto's avatar Fabio Busatto Committed by Zeger-Jan van de Weg

Update to Spring Boot 2

parent ed5f6c19
target/
/target/
!.mvn/wrapper/maven-wrapper.jar
### STS ###
......@@ -8,6 +8,7 @@ target/
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
......@@ -16,9 +17,9 @@ target/
*.ipr
### NetBeans ###
nbproject/private/
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
\ No newline at end of file
/nbproject/private/
/build/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip
### Java Spring template project
This project is based on a GitLab [Project Template](https://docs.gitlab.com/ee/gitlab-basics/create-project.html)
This project is based on a GitLab [Project Template](https://docs.gitlab.com/ee/gitlab-basics/create-project.html).
Additions and changes to the project can be proposed in the [original project](https://gitlab.com/gitlab-org/project-templates/spring)
Additions and changes to the project can be proposed in the [original project](https://gitlab.com/gitlab-org/project-templates/spring).
### CI/CD with Auto DevOps
This template is compatible with [Auto DevOps](https://docs.gitlab.com/ee/topics/autodevops/).
If Auto DevOps is not already enabled for this project, you can [turn it on](https://docs.gitlab.com/ee/topics/autodevops/#enabling-auto-devops)
in the project settings. Otherwise, you can create a custom `.gitlab-ci.yml` file and customize it.
If Auto DevOps is not already enabled for this project, you can [turn it on](https://docs.gitlab.com/ee/topics/autodevops/#enabling-auto-devops) in the project settings.
Otherwise, you can create a custom `.gitlab-ci.yml` file and customize it.
......@@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.6.RELEASE</version>
<version>2.0.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
......
......@@ -3,14 +3,26 @@ package com.example.demo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.junit4.SpringRunner;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringRunner.class)
@SpringBootTest
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
public class DemoApplicationTests {
@Test
public void contextLoads() {
}
@Autowired
private TestRestTemplate restTemplate;
@Test
public void homeResponse() {
String body = this.restTemplate.getForObject("/", String.class);
assertThat(body).isEqualTo("Spring is here!");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment