Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ gradlew

.idea/

.DS_Store
.DS_Store

# Secrets #
.env
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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__:
- <https://editor.swagger.io> - Online OpenApi viewer

## Building & Running
- Sonarlint - can be used via an IntelliJ plugin, gradle with `gradle solarlintMain` and is used in CI

## Testing

Expand Down
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down