diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index a057267..0120a75 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -2,7 +2,7 @@ name: tests run-name: Tests on: [pull_request] jobs: - postman-tests: + tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -14,6 +14,9 @@ jobs: - uses: gradle/gradle-build-action@v2 - run: gradle bootJar - run: java -jar build/libs/yaposs-0.0.1-SNAPSHOT.jar 2>&1 & - - uses: matt-ball/newman-action@master + - name: Postman tests + uses: matt-ball/newman-action@master with: collection: postman_collection.json + - name: Sonarlint + run: gradle sonarlintMain diff --git a/.gitignore b/.gitignore index a0b4819..180fc62 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,7 @@ gradlew .idea/ -.DS_Store \ No newline at end of file +.DS_Store + +# Secrets # +.env diff --git a/README.md b/README.md index dda7e26..ffc9f9f 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,14 @@ __Build tool__: Gradle (run with `gradle bootRun`) -__IDE__: IntelliJ IDEA CE (it's free btw) +__IDE__: IntelliJ IDEA CE (it's free btw), with these plugins: +- Sonarlint __Java version__: OpenJDK 17 __Others useful tools__: - - Online OpenApi viewer - -## Building & Running +- Sonarlint - can be used via an IntelliJ plugin, gradle with `gradle solarlintMain` and is used in CI ## Testing diff --git a/build.gradle b/build.gradle index ef075b0..3702bf2 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { id 'org.springframework.boot' version '3.2.0' id 'io.spring.dependency-management' version '1.1.4' id "com.google.protobuf" version "0.9.4" - id 'com.bmuschko.docker-spring-boot-application' version '6.7.0' + id "name.remal.sonarlint" version "3.4.1" } group = 'com.spaghettininjas' @@ -42,7 +42,9 @@ protobuf { tasks.register('postman') { dependsOn 'bootJar' - exec { - commandLine 'newman', 'run', 'postman_collection.json' + doLast { + exec { + commandLine 'newman', 'run', 'postman_collection.json' + } } } \ No newline at end of file diff --git a/src/main/java/com/spaghettininjas/yaposs/controllers/CustomersController.java b/src/main/java/com/spaghettininjas/yaposs/controllers/CustomersController.java index 8cfa75a..f3bfa01 100644 --- a/src/main/java/com/spaghettininjas/yaposs/controllers/CustomersController.java +++ b/src/main/java/com/spaghettininjas/yaposs/controllers/CustomersController.java @@ -10,7 +10,7 @@ @RequestMapping("/api/Customers") public class CustomersController { - @RequestMapping(value = "/{id}", method = RequestMethod.GET, produces=MediaType.APPLICATION_JSON_VALUE) + @GetMapping(value = "/{id}", produces=MediaType.APPLICATION_JSON_VALUE) Customer get(@PathVariable int id) { return Customer.newBuilder() .setId(id)