This repository has been archived by the owner on Dec 4, 2024. It is now read-only.
-
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 #2 from 7SOATSquad30/build/add-static-analysis
build: add static analysis
- Loading branch information
Showing
3 changed files
with
49 additions
and
32 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
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,54 +1,60 @@ | ||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '3.2.5' | ||
id 'io.spring.dependency-management' version '1.1.4' | ||
id 'com.diffplug.spotless' version '6.25.0' | ||
id 'java' | ||
id 'org.springframework.boot' version '3.2.5' | ||
id 'io.spring.dependency-management' version '1.1.4' | ||
id 'com.diffplug.spotless' version '6.25.0' | ||
id 'pmd' | ||
} | ||
|
||
group = 'br.com.fiap.grupo30' | ||
version = '0.0.1-SNAPSHOT' | ||
|
||
java { | ||
sourceCompatibility = '21' | ||
sourceCompatibility = '21' | ||
} | ||
|
||
configurations { | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
compileOnly { | ||
extendsFrom annotationProcessor | ||
} | ||
} | ||
|
||
spotless { | ||
format 'misc', { | ||
// define the files to apply `misc` to | ||
target '*.gradle', '.gitattributes', '.gitignore' | ||
|
||
// define the steps to apply to those files | ||
trimTrailingWhitespace() | ||
indentWithTabs() // or spaces. Takes an integer argument if you don't like 4 | ||
endWithNewline() | ||
} | ||
java { | ||
googleJavaFormat('1.22.0').aosp().reflowLongStrings().skipJavadocFormatting() | ||
formatAnnotations() | ||
target 'src/main/**/*.java', 'src/test/**/*.java' | ||
} | ||
format 'misc', { | ||
target '*.gradle', '.gitattributes', '.gitignore' | ||
|
||
trimTrailingWhitespace() | ||
indentWithSpaces() | ||
endWithNewline() | ||
} | ||
java { | ||
googleJavaFormat('1.22.0').aosp().reflowLongStrings().skipJavadocFormatting() | ||
formatAnnotations() | ||
target 'src/main/**/*.java', 'src/test/**/*.java' | ||
} | ||
} | ||
|
||
pmd { | ||
toolVersion = '7.1.0' | ||
ruleSets = ["category/java/errorprone.xml", "category/java/bestpractices.xml"] | ||
consoleOutput = true | ||
sourceSets = [sourceSets.main, sourceSets.test] | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
compileOnly 'org.projectlombok:lombok' | ||
runtimeOnly 'com.h2database:h2' | ||
runtimeOnly 'org.postgresql:postgresql' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
compileOnly 'org.projectlombok:lombok' | ||
runtimeOnly 'com.h2database:h2' | ||
runtimeOnly 'org.postgresql:postgresql' | ||
annotationProcessor 'org.projectlombok:lombok' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
useJUnitPlatform() | ||
} |
8 changes: 7 additions & 1 deletion
8
src/test/java/br/com/fiap/grupo30/fastfood/FastfoodApplicationTests.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,11 +1,17 @@ | ||
package br.com.fiap.grupo30.fastfood; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
|
||
@SpringBootTest | ||
class FastfoodApplicationTests { | ||
|
||
@Test | ||
void contextLoads() {} | ||
void contextLoads() { | ||
int x = 1; | ||
int y = 1; | ||
assertTrue(x == y, "assertion failed"); | ||
} | ||
} |