@@ -40,20 +40,22 @@ Before running the tests, ensure you have the following installed and configured
4040cd apiTest
4141
4242# Run all tests
43- gradle test
43+ ../gradlew test
4444
4545# Run tests with more verbose output
46- gradle test --info
46+ ../gradlew test --info
4747
4848# Run tests with debug output
49- gradle test --debug
49+ ../gradlew test --debug
5050```
5151
5252### From the apiTest Directory
5353
5454``` bash
55- # If you're already in the apiTest directory
56- gradle test
55+ # If you're already in the apiTest directory, you can use either:
56+ ./gradlew test # Uses apiTest's own Gradle wrapper
57+ # or
58+ ../gradlew test # Uses root project's Gradle wrapper
5759```
5860
5961### What Happens When You Run Tests
@@ -71,10 +73,10 @@ gradle test
7173
7274``` bash
7375# Run a specific test class
74- gradle test --tests " RootApiTest"
76+ ../gradlew test --tests " RootApiTest"
7577
7678# Run a specific test method
77- gradle test --tests " RootApiTest.root_endpoint_should_be_ok"
79+ ../gradlew test --tests " RootApiTest.root_endpoint_should_be_ok"
7880```
7981
8082## Test Reports
@@ -102,15 +104,15 @@ These XML reports are useful for CI/CD integration.
102104### Issue: "Could not start Gradle Test Executor 1: Failed to load JUnit Platform"
103105
104106** Solution:** This should be resolved with the current configuration. If you see this error:
105- 1 . Clean the build: ` gradle clean`
106- 2 . Rebuild: ` gradle build`
107+ 1 . Clean the build: ` ../gradlew clean`
108+ 2 . Rebuild: ` ../gradlew build`
107109
108110### Issue: "no main manifest attribute, in /app/apiTest-0.0.999.jar"
109111
110112** Solution:** This means the Docker build context is wrong. Ensure:
1111131 . The ` docker-compose.yml ` has ` context: .. ` (builds from root directory)
1121142 . The root project's ` bootJar ` is built before Docker build
113- 3 . Run: ` gradle buildRootBootJar` manually if needed
115+ 3 . Run: ` ../gradlew buildRootBootJar` manually if needed
114116
115117### Issue: Container exits with code 1
116118
@@ -152,26 +154,6 @@ lsof -i :5432
152154- Check database logs: ` docker-compose -f docker-compose.yml logs db `
153155- Verify connection string in ` docker-compose.yml ` matches database configuration
154156
155- ## Manual Container Management
156-
157- If you need to manually manage containers:
158-
159- ``` bash
160- # Start containers without running tests
161- docker-compose -f docker-compose.yml up -d
162-
163- # Stop containers
164- docker-compose -f docker-compose.yml down
165-
166- # View container logs
167- docker-compose -f docker-compose.yml logs -f app
168-
169- # Check container status
170- docker-compose -f docker-compose.yml ps
171-
172- # Rebuild containers
173- docker-compose -f docker-compose.yml build --no-cache
174- ```
175157
176158## Test Configuration
177159
@@ -186,6 +168,6 @@ Tests use the following default configuration:
186168
187169You can override the application URL:
188170``` bash
189- gradle test -Dapp.baseUrl=http://localhost:8080
171+ ../gradlew test -Dapp.baseUrl=http://localhost:8080
190172```
191173
0 commit comments