-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Mastercard/fixes-documentation
fixing initial issues for the documentation
- Loading branch information
Showing
18 changed files
with
231 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Build & Test | ||
'on': | ||
push: | ||
branches: | ||
- "**" | ||
pull_request: | ||
branches: | ||
- "**" | ||
schedule: | ||
- cron: 0 16 * * * | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: | ||
- 17 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 0 | ||
- name: 'Set up JDK ${{ matrix.java }}' | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: '${{ matrix.java }}' | ||
- name: Build and test with Maven | ||
run: mvn -B package -Dgpg.signature.skip=true -Dspring.profiles.active=oauth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Sonar | ||
'on': | ||
push: | ||
branches: | ||
- "**" | ||
pull_request_target: | ||
branches: | ||
- "**" | ||
types: [opened, synchronize, reopened, labeled] | ||
schedule: | ||
- cron: 0 16 * * * | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 17 | ||
java-package: jdk | ||
|
||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check for external PR | ||
if: ${{ !(contains(github.event.pull_request.labels.*.name, 'safe') || | ||
github.event.pull_request.head.repo.full_name == github.repository || | ||
github.event_name != 'pull_request_target') }} | ||
run: echo "Unsecure PR, must be labelled with the 'safe' label, then run the workflow again" && exit 1 | ||
|
||
- name: Build with Maven | ||
|
||
mvn clean install | ||
|
||
- name: Sonar Scan | ||
env: | ||
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | ||
SONAR_TOKEN: '${{ secrets.SONAR_TOKEN }}' | ||
run: >- | ||
mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar | ||
-Dsonar.projectName=client-encryption-java | ||
-Dsonar.projectKey=Mastercard_client-encryption-java | ||
-Dsonar.organization=mastercard -Dsonar.host.url=https://sonarcloud.io | ||
-Dsonar.login=$SONAR_TOKEN -Dsonar.cpd.exclusions=**/OkHttp*.java | ||
-Dsonar.exclusions=**/*.xml -Dgpg.signature.skip=true | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 43 additions & 1 deletion
44
src/main/java/com/mastercard/app/petstore/PetstoreApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,55 @@ | ||
package com.mastercard.app.petstore; | ||
|
||
import com.mastercard.app.petstore.examples.AdoptionFlowExample; | ||
import com.mastercard.app.petstore.examples.EmployeeFlowExample; | ||
import com.mastercard.app.petstore.examples.PetFlowExample; | ||
import org.openapitools.client.ApiException; | ||
import org.openapitools.client.model.Adoption; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.CommandLineRunner; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.context.ApplicationContext; | ||
import org.springframework.context.annotation.Bean; | ||
|
||
@SpringBootApplication | ||
public class PetstoreApplication { | ||
@Autowired | ||
PetFlowExample petFlowExample; | ||
@Autowired | ||
AdoptionFlowExample adoptionFlowExample; | ||
@Autowired | ||
EmployeeFlowExample employeeFlowExample; | ||
|
||
@Bean | ||
PetFlowExample petFlowExample() throws ApiException { | ||
petFlowExample = new PetFlowExample(); | ||
return petFlowExample; | ||
} | ||
|
||
@Bean | ||
AdoptionFlowExample adoptionFlowExample() { | ||
adoptionFlowExample = new AdoptionFlowExample(); | ||
return adoptionFlowExample; | ||
} | ||
|
||
@Bean | ||
EmployeeFlowExample employeeFlowExample() { | ||
employeeFlowExample = new EmployeeFlowExample(); | ||
return employeeFlowExample; | ||
} | ||
|
||
@Bean | ||
public CommandLineRunner commandLineRunner(ApplicationContext ctx) { | ||
|
||
return args -> { | ||
petFlowExample.petUseCaseFlow(); | ||
adoptionFlowExample.adoptionUseCase(); | ||
employeeFlowExample.employeeUseCase(); | ||
}; | ||
} | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(PetstoreApplication.class, args); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.