Skip to content

Commit 6786fb9

Browse files
committed
added github actions and setup test
1 parent fd31001 commit 6786fb9

3 files changed

Lines changed: 8 additions & 14 deletions

File tree

.github/workflows/maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
java-version: '11'
2323
distribution: 'adopt'
2424
- name: Build with Maven
25-
run: mvn clean verify #mvn -B package --file pom.xml
25+
run: mvn test -Dtest=RestAPITest #mvn -B package --file pom.xml

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ Basic [Java Spring Boot](https://spring.io/projects/spring-boot) application
1111
## How to run in Docker
1212
1. build image: ```docker build -t myspringboot .```
1313
2. run app: ```docker run -p 8080:8081 myspringboot```
14+
15+
## Run Tests
16+
17+
- run REST API Tests only: ```mvn test -Dtest=RestAPITest```
18+
- run Cucumber tests: ```mvn test```
1419
## To Do
1520

1621
- [x] [setup IntelliJ IDE](https://www.youtube.com/watch?v=H_XxH66lm3U&t=84s)
@@ -23,8 +28,9 @@ Basic [Java Spring Boot](https://spring.io/projects/spring-boot) application
2328
- [x] add selenium tests
2429
- [x] [Dockerize app](https://spring.io/guides/gs/spring-boot-docker/)
2530
- [ ] use Jenkinsfile
31+
- [ ] Jmeter tests
2632
- [ ] solve issue with mvn test not picking up cucumber tests
27-
33+
- [ ] add github actions
2834
## Dependency Injection
2935
- [Spring IOC Container](https://docs.spring.io/spring-framework/docs/3.1.x/spring-framework-reference/html/beans.html)
3036
- @Autowired

src/test/java/com/example/JavaSpringBoot/RestAPITest.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.example.JavaSpringBoot;
22
import org.junit.jupiter.api.Test;
3-
import org.openqa.selenium.WebDriver;
4-
import org.openqa.selenium.chrome.ChromeDriver;
53
import org.springframework.beans.factory.annotation.Autowired;
64
import org.springframework.boot.test.context.SpringBootTest;
75
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
@@ -27,14 +25,4 @@ public void greetingShouldReturnDefaultMessage() throws Exception {
2725
System.out.println("***** Verified Hello Endpoint is working ******");
2826
}
2927

30-
@Test
31-
public void simpleSeleniumTest() {
32-
WebDriver driver = null;
33-
driver = new ChromeDriver();
34-
driver.get("http://localhost:" + port);
35-
driver.navigate().to("http://localhost:" + port + "/hello");
36-
System.out.println("Inside selenium test");
37-
driver.quit();
38-
39-
}
4028
}

0 commit comments

Comments
 (0)