File tree Expand file tree Collapse file tree
src/test/java/com/example/JavaSpringBoot Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ Basic [Java Spring Boot](https://spring.io/projects/spring-boot) application
1111## How to run in Docker
12121 . build image: ``` docker build -t myspringboot . ```
13132 . 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
Original file line number Diff line number Diff line change 11package com .example .JavaSpringBoot ;
22import org .junit .jupiter .api .Test ;
3- import org .openqa .selenium .WebDriver ;
4- import org .openqa .selenium .chrome .ChromeDriver ;
53import org .springframework .beans .factory .annotation .Autowired ;
64import org .springframework .boot .test .context .SpringBootTest ;
75import 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}
You can’t perform that action at this time.
0 commit comments