Minor cleanup

This commit is contained in:
Erik C. Thauvin 2023-11-20 23:22:39 -08:00
parent 9175393baa
commit fe849c8a59
4 changed files with 21 additions and 13 deletions

View file

@ -6,6 +6,7 @@
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.5-sources.jar!/" />
</SOURCES>
<excluded>
@ -14,4 +15,4 @@
<jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" type="SOURCES" />
</library>
</component>
</component>

View file

@ -4,12 +4,20 @@ Based on the Spring Guides' Spring Boot web application example. Please be sure
[guide](https://spring.io/guides/gs/spring-boot/) for a sampling of how Spring Boot can help
you accelerate application development
## Running the Application
## Compile the Application
To run the web application, issue the following command:
To compile the web application, issue the following command:
```
./bld compile run
./bld compile
```
## Running the Application
To run the compiled web application, issue the following command:
```
./bld run
```
To access the web application, issue the follow command:
@ -28,7 +36,7 @@ curl -X POST localhost:8080/actuator/shutdown
## Testing the Application
To run the web application tests, issue the following command:
To run the compiled web application tests, issue the following command:
```
./bld test
@ -39,7 +47,7 @@ To run the web application tests, issue the following command:
To build and launch the executable JAR, issue the following commands:
```
./bld bootjar
./bld compile bootjar
java -jar build/dist/demoapplication-0.1.0-boot.jar
```
@ -48,6 +56,6 @@ java -jar build/dist/demoapplication-0.1.0-boot.jar
To build and launch the executable WAR, issue the following commands:
```
./bld bootwar
./bld compile bootwar
java -jar build/dist/demoapplication-0.1.0-boot.war
```

View file

@ -29,8 +29,8 @@ public class ApplicationBuild extends WebProject {
.include(dependency("org.springframework.boot:spring-boot-starter-web:3.1.5"));
scope(test)
.include(dependency("org.springframework.boot:spring-boot-starter-test:3.1.5"))
.include(dependency("org.junit.jupiter:junit-jupiter:5.10.0"))
.include(dependency("org.junit.platform:junit-platform-console-standalone:1.10.0"));
.include(dependency("org.junit.jupiter:junit-jupiter:5.10.1"))
.include(dependency("org.junit.platform:junit-platform-console-standalone:1.10.1"));
scope(standalone)
.include(dependency("org.springframework.boot:spring-boot-loader:3.1.5"));
}

View file

@ -4,7 +4,6 @@ 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;
import org.springframework.http.ResponseEntity;
import static org.assertj.core.api.Assertions.assertThat;
@ -13,13 +12,13 @@ public class HelloControllerIT {
@Autowired
private TestRestTemplate template;
public static void main(String[] args) throws Exception {
public static void main(String[] args) {
new HelloControllerIT().getHello();
}
@Test
public void getHello() throws Exception {
ResponseEntity<String> response = template.getForEntity("/", String.class);
public void getHello() {
var response = template.getForEntity("/", String.class);
assertThat(response.getBody()).isEqualTo("Greetings from Spring Boot!");
}
}