-
Notifications
You must be signed in to change notification settings - Fork 82
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 #541 from spacious-team/task-gh-465
Добавить checker framework и github action для юнит тестов
- Loading branch information
Showing
249 changed files
with
1,973 additions
and
1,350 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,47 @@ | ||
name: Unit Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- 'master' | ||
- 'develop' | ||
push: | ||
branches: | ||
- 'master' | ||
- 'develop' | ||
|
||
jobs: | ||
tests: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '22' | ||
distribution: 'liberica' | ||
cache: maven | ||
|
||
- name: Maven Tests | ||
run: mvn --batch-mode clean test | ||
|
||
- name: Test Coverage | ||
uses: codecov/codecov-action@v4 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: SonarCloud Analyze | ||
run: > | ||
mvn --batch-mode sonar:sonar | ||
-Dsonar.projectKey=spacious-team_investbook | ||
-Dsonar.organization=spacious-team | ||
-Dsonar.host.url=https://sonarcloud.io | ||
-Dsonar.login=$SONAR_TOKEN | ||
-Dsonar.coverage.jacoco.xmlReportPaths=./target/site/jacoco/jacoco.xml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* InvestBook | ||
* Copyright (C) 2024 Spacious Team <spacious-team@ya.ru> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
import org.checkerframework.checker.nullness.qual.Nullable; | ||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull; | ||
import org.checkerframework.checker.nullness.qual.EnsuresNonNullIf; | ||
|
||
package java.util; | ||
public class Objects { | ||
|
||
@EnsuresNonNull("#1") | ||
static <T> T requireNonNull(@Nullable T obj); | ||
|
||
@EnsuresNonNull("#1") | ||
static <T> T requireNonNull(@Nullable T obj, String message); | ||
|
||
@EnsuresNonNull("#1") | ||
static <T> T requireNonNull(@Nullable T obj, Supplier<String> messageSupplier); | ||
|
||
@EnsuresNonNullIf(expression="#1", result=true) | ||
static boolean nonNull(@Nullable Object obj); | ||
|
||
@EnsuresNonNullIf(expression="#1", result=false) | ||
static boolean isNull(@Nullable Object obj); | ||
} | ||
|
||
|
||
package org.springframework.util; | ||
class StringUtils { | ||
|
||
@EnsuresNonNullIf(expression="#1", result=true) | ||
static boolean hasText(@Nullable CharSequence str); | ||
|
||
@EnsuresNonNullIf(expression="#1", result=true) | ||
static boolean hasText(@Nullable String str); | ||
|
||
@EnsuresNonNullIf(expression="#1", result=true) | ||
static boolean hasLength(@Nullable CharSequence str); | ||
|
||
@EnsuresNonNullIf(expression="#1", result=true) | ||
static boolean hasLength(@Nullable String str); | ||
} | ||
|
||
|
||
package org.springframework.util; | ||
class CollectionUtils { | ||
|
||
@EnsuresNonNullIf(expression="#1", result=false) | ||
static boolean isEmpty(@Nullable Collection<?> collection); | ||
|
||
@EnsuresNonNullIf(expression="#1", result=false) | ||
static boolean isEmpty(@Nullable Map<?, ?> map); | ||
} | ||
|
||
|
||
package org.slf4j; | ||
interface Logger { | ||
|
||
void warn(String format, @Nullable Object arg1, @Nullable Object arg2); | ||
|
||
void warn(String format, @Nullable Object... arguments); | ||
} |
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.