Skip to content

Commit

Permalink
Merge pull request #79 from ssylver93/feature/WFPREV-34_3
Browse files Browse the repository at this point in the history
Test sonar
  • Loading branch information
ssylver93 authored Sep 25, 2024
2 parents 49012d1 + a4e7821 commit 487892c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 26 deletions.
26 changes: 1 addition & 25 deletions .github/workflows/sonarscan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,9 @@ jobs:
sonar:
name: Test - SonarCloud Scan
runs-on: ubuntu-latest
services:
postgres:
image: postgis/postgis:16-3.4
ports:
- 5432:5432
env:
POSTGRES_USER: wfprev
POSTGRES_PASSWORD: password
POSTGRES_DB: wfprevdb
options: --health-cmd="pg_isready -U wfprev -d wfprevdb" --health-interval=10s --health-timeout=5s --health-retries=5

steps:
- uses: actions/checkout@v4

- name: Wait for Postgres to be ready
run: |
for i in {1..30}; do
if pg_isready -h postgres -p 5432 -U wfprev -d wfprevdb; then
echo "Postgres is ready!"
break
fi
echo "Waiting for Postgres..."
sleep 2
done
- name: Set up JDK 17
uses: actions/setup-java@v4
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'adopt'
Expand Down
12 changes: 11 additions & 1 deletion server/wfprev-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,18 @@
<artifactId>sonar-maven-plugin</artifactId>
<version>4.0.0.4121</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.1</version>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Import;
import org.springframework.hateoas.CollectionModel;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;
Expand All @@ -23,6 +24,7 @@
import ca.bc.gov.nrs.wfprev.data.resources.ExampleModel;
import ca.bc.gov.nrs.wfprev.services.ExampleService;

@Import(TestcontainersConfiguration.class)
@SpringBootTest
@AutoConfigureMockMvc
class ExampleControllerTest {
Expand Down

0 comments on commit 487892c

Please sign in to comment.