Skip to content
Merged
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
10 changes: 8 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,26 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 11

- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build and analyze

- name: Build and Test
run: ./gradlew build test

- name: Sonarqube
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonarqube --info
run: ./gradlew sonarqube --info
Binary file removed .gradle/6.8.3/executionHistory/executionHistory.bin
Binary file not shown.
Binary file removed .gradle/6.8.3/executionHistory/executionHistory.lock
Binary file not shown.
Binary file removed .gradle/6.8.3/fileChanges/last-build.bin
Binary file not shown.
Binary file removed .gradle/6.8.3/fileHashes/fileHashes.bin
Binary file not shown.
Binary file removed .gradle/6.8.3/fileHashes/fileHashes.lock
Binary file not shown.
Empty file removed .gradle/6.8.3/gc.properties
Empty file.
Binary file removed .gradle/6.8.3/javaCompile/classAnalysis.bin
Binary file not shown.
Binary file removed .gradle/6.8.3/javaCompile/javaCompile.lock
Binary file not shown.
Binary file removed .gradle/6.8.3/javaCompile/taskHistory.bin
Binary file not shown.
Binary file removed .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
2 changes: 0 additions & 2 deletions .gradle/buildOutputCleanup/cache.properties

This file was deleted.

Binary file removed .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file removed .gradle/checksums/checksums.lock
Binary file not shown.
Binary file removed .gradle/checksums/md5-checksums.bin
Binary file not shown.
Binary file removed .gradle/checksums/sha1-checksums.bin
Binary file not shown.
Empty file.
Empty file removed .gradle/vcs-1/gc.properties
Empty file.
1 change: 1 addition & 0 deletions bin/main/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file added bin/main/com/sample/SampleApplication.class
Binary file not shown.
Binary file added bin/main/com/sample/SampleController.class
Binary file not shown.
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ sonarqube {
// property "sonar.host.url", "http://127.0.0.1:9000"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.sources", "."
property "sonar.java.binaries", "build"
property "sonar.exclusions", "**/node_modules/**, **/cdk.out/**"
property "sonar.issue.ignore.multicriteria", "e1"
property "sonar.issue.ignore.multicriteria.e1.ruleKey", "typescript:S1848"
Expand Down
12 changes: 0 additions & 12 deletions src/main/java/com/sec/sample/DemoApplication.java

This file was deleted.

19 changes: 0 additions & 19 deletions src/main/java/com/sec/sample/SampleController.java

This file was deleted.

53 changes: 53 additions & 0 deletions src/test/java/com/sample/SampleControllerTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.sample;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Assertions;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.ResponseEntity;
import org.springframework.http.HttpStatus;
import org.springframework.test.context.ActiveProfiles;

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ActiveProfiles("test")
public class SampleControllerTest {

@Autowired
private TestRestTemplate restTemplate;

@Test
public void testHome() {
ResponseEntity<String> response = restTemplate.getForEntity("/", String.class);
Assertions.assertEquals(HttpStatus.OK, response.getStatusCode());
Assertions.assertEquals("OK", response.getBody());
}

@Test
public void testPingPath1() {
ResponseEntity<String> response = restTemplate.getForEntity("/sample", String.class);
Assertions.assertEquals(HttpStatus.OK, response.getStatusCode());
Assertions.assertEquals("OK", response.getBody());
}

@Test
public void testPingPath2() {
ResponseEntity<String> response = restTemplate.getForEntity("/sample/test1", String.class);
Assertions.assertEquals(HttpStatus.OK, response.getStatusCode());
Assertions.assertEquals("OK", response.getBody());
}

@Test
public void testPingPath3() {
ResponseEntity<String> response = restTemplate.getForEntity("/sample/test1/test2", String.class);
Assertions.assertEquals(HttpStatus.OK, response.getStatusCode());
Assertions.assertEquals("OK", response.getBody());
}

@Test
public void testPingPath4() {
ResponseEntity<String> response = restTemplate.getForEntity("/sample/test1/test2/test3", String.class);
Assertions.assertEquals(HttpStatus.OK, response.getStatusCode());
Assertions.assertEquals("OK", response.getBody());
}
}