feature/run-office-module-without-booking-and-hosting #148

Merged
hsh-michaelhoennig merged 19 commits from feature/run-office-module-without-booking-and-hosting into master 2025-01-21 14:36:53 +01:00
91 changed files with 643 additions and 101 deletions

View File

@ -90,8 +90,37 @@ alias pg-sql-restore='gunzip --stdout | docker exec -i hsadmin-ng-postgres psql
alias fp='grep -r '@Accepts' src | sed -e 's/^.*@/@/g' | sort -u | wc -l' alias fp='grep -r '@Accepts' src | sed -e 's/^.*@/@/g' | sort -u | wc -l'
alias gw-spotless='./gradlew spotlessApply -x pitest -x test -x :processResources' alias gw-spotless='./gradlew spotlessApply -x pitest -x test -x :processResources'
alias gw-test='. .aliases; ./gradlew test' alias gw-check='. .aliases; . .tc-environment; gw test check -x pitest'
alias gw-check='. .aliases; gw test check -x pitest'
# HOWTO: run all 'normal' tests (no scenario+import-tests): `gw-test`
# You can also mention specific targets: `gw-test importOfficeData`.
# This will always use the environment from `.tc-environment`.
#
# HOWTO: re-run tests even if no changed can be detected: `gw-test --rerun`
# You can also mention specific targets: `gw-test scenarioTest --rerun`.
# This will always use the environment from `.tc-environment`.
#
# HOWTO: run all tests (unit, integration+acceptance, import and scenario): `gw-test --all`
# You can also re-run all these tests, which will take ~20min: `gw-test --all --rerun`
# This will always use the environment from `.tc-environment`.
#
function _gwTest() {
. .aliases;
. .tc-environment;
if [ "$1" == "--all" ]; then
shift # to remove the --all from $@
# delierately in separate gradlew-calls to avoid Testcontains-PostgreSQL problem spillover
./gradlew unitTest "$@" &&
./gradlew officeIntegrationTest bookingIntegrationTest hostingIntegrationTest "$@" &&
./gradlew scenarioTest "$@" &&
./gradlew importOfficeData importHostingAssets "$@";
elif [ $# -eq 0 ] || [[ $1 == -* ]]; then
./gradlew test "$@";
else
./gradlew "$@";
fi
}
alias gw-test=_gwTest
alias howto=bin/howto alias howto=bin/howto
alias cas-curl=bin/cas-curl alias cas-curl=bin/cas-curl
@ -107,6 +136,6 @@ if [ ! -f .environment ]; then
fi fi
source .environment source .environment
alias scenario-reports-upload='./gradlew scenarioTests convertMarkdownToHtml && ssh hsh03-hsngdev@h50.hostsharing.net "rm -f doms/hsngdev.hs-example.de/htdocs-ssl/scenarios/office/*.html" && scp build/doc/scenarios/*.html hsh03-hsngdev@h50.hostsharing.net:doms/hsngdev.hs-example.de/htdocs-ssl/scenarios/office' alias scenario-reports-upload='./gradlew scenarioTest convertMarkdownToHtml && ssh hsh03-hsngdev@h50.hostsharing.net "rm -f doms/hsngdev.hs-example.de/htdocs-ssl/scenarios/office/*.html" && scp build/doc/scenarios/*.html hsh03-hsngdev@h50.hostsharing.net:doms/hsngdev.hs-example.de/htdocs-ssl/scenarios/office'
alias scenario-reports-open='open https://hsngdev.hs-example.de/scenarios/office' alias scenario-reports-open='open https://hsngdev.hs-example.de/scenarios/office'

View File

@ -4,5 +4,4 @@ export HSADMINNG_POSTGRES_ADMIN_PASSWORD=
export HSADMINNG_POSTGRES_RESTRICTED_USERNAME=restricted export HSADMINNG_POSTGRES_RESTRICTED_USERNAME=restricted
export HSADMINNG_SUPERUSER=superuser-alex@hostsharing.net export HSADMINNG_SUPERUSER=superuser-alex@hostsharing.net
export HSADMINNG_MIGRATION_DATA_PATH=migration export HSADMINNG_MIGRATION_DATA_PATH=migration
export LIQUIBASE_COMMAND_CONTEXT_FILTER=
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8

View File

@ -4,5 +4,4 @@ unset HSADMINNG_POSTGRES_ADMIN_PASSWORD
unset HSADMINNG_POSTGRES_RESTRICTED_USERNAME unset HSADMINNG_POSTGRES_RESTRICTED_USERNAME
unset HSADMINNG_SUPERUSER unset HSADMINNG_SUPERUSER
unset HSADMINNG_MIGRATION_DATA_PATH unset HSADMINNG_MIGRATION_DATA_PATH
unset LIQUIBASE_COMMAND_CONTEXT_FILTER

21
Jenkinsfile vendored
View File

@ -35,9 +35,24 @@ pipeline {
stage ('Tests') { stage ('Tests') {
parallel { parallel {
stage('Unit-/Integration/Acceptance-Tests') { stage('Unit-Tests') {
steps { steps {
sh './gradlew check --no-daemon -x pitest -x dependencyCheckAnalyze -x importOfficeData -x importHostingAssets' sh './gradlew unitTest --no-daemon'
}
}
stage('General-Tests') {
steps {
sh './gradlew generalTest --no-daemon'
}
}
stage('Office-Tests') {
steps {
sh './gradlew officeIntegrationTest --no-daemon'
}
}
stage('Booking+Hosting-Tests') {
steps {
sh './gradlew bookingIntegrationTest hostingIntegrationTest --no-daemon'
} }
} }
stage('Import-Tests') { stage('Import-Tests') {
@ -47,7 +62,7 @@ pipeline {
} }
stage ('Scenario-Tests') { stage ('Scenario-Tests') {
steps { steps {
sh './gradlew scenarioTests --no-daemon' sh './gradlew scenarioTest --no-daemon'
} }
} }
} }

162
README.md
View File

@ -5,41 +5,48 @@ For architecture consider the files in the `doc` and `adr` folder.
<!-- generated TOC begin: --> <!-- generated TOC begin: -->
- [Setting up the Development Environment](#setting-up-the-development-environment) - [Setting up the Development Environment](#setting-up-the-development-environment)
- [PostgreSQL Server](#postgresql-server) - [PostgreSQL Server](#postgresql-server)
- [Markdown](#markdown) - [Markdown](#markdown)
- [Render Markdown embedded PlantUML](#render-markdown-embedded-plantuml) - [Render Markdown embedded PlantUML](#render-markdown-embedded-plantuml)
- [Render Markdown Embedded Mermaid Diagrams](#render-markdown-embedded-mermaid-diagrams) - [Render Markdown Embedded Mermaid Diagrams](#render-markdown-embedded-mermaid-diagrams)
- [IDE Specific Settings](#ide-specific-settings) - [IDE Specific Settings](#ide-specific-settings)
- [IntelliJ IDEA](#intellij-idea) - [IntelliJ IDEA](#intellij-idea)
- [Other Tools](#other-tools) - [Other Tools](#other-tools)
- [Running the SQL files](#running-the-sql-files) - [Running the SQL files](#running-the-sql-files)
- [For RBAC](#for-rbac) - [For RBAC](#for-rbac)
- [For Historization](#for-historization) - [For Historization](#for-historization)
- [Coding Guidelines](#coding-guidelines) - [Coding Guidelines](#coding-guidelines)
- [Directory and Package Structure](#directory-and-package-structure) - [Directory and Package Structure](#directory-and-package-structure)
- [General Directory Structure](#general-directory-structure) - [General Directory Structure](#general-directory-structure)
- [Source Code Package Structure](#source-code-package-structure) - [Source Code Package Structure](#source-code-package-structure)
- [Run Tests from Command Line](#run-tests-from-command-line) - [Run Tests from Command Line](#run-tests-from-command-line)
- [Spotless Code Formatting](#spotless-code-formatting) - [Spotless Code Formatting](#spotless-code-formatting)
- [JaCoCo Test Code Coverage Check](#jacoco-test-code-coverage-check) - [JaCoCo Test Code Coverage Check](#jacoco-test-code-coverage-check)
- [PiTest Mutation Testing](#pitest-mutation-testing) - [PiTest Mutation Testing](#pitest-mutation-testing)
- [Remark](#remark) - [Remark](#remark)
- [OWASP Security Vulnerability Check](#owasp-security-vulnerability-check) - [OWASP Security Vulnerability Check](#owasp-security-vulnerability-check)
- [Dependency-License-Compatibility](#dependency-license-compatibility) - [Dependency-License-Compatibility](#dependency-license-compatibility)
- [Dependency Version Upgrade](#dependency-version-upgrade) - [Dependency Version Upgrade](#dependency-version-upgrade)
- [Biggest Flaws in our Architecture](#biggest-flaws-in-our-architecture)
- [The RBAC System is too Complicated](#the-rbac-system-is-too-complicated)
- [The Mapper is Error-Prone](#the-mapper-is-error-prone)
- [Too Many Business-Rules Implemented in Controllers](#too-many-business-rules-implemented-in-controllers)
- [How To ...](#how-to-...) - [How To ...](#how-to-...)
- [How to Configure .pgpass for the Default PostgreSQL Database?](#how-to-configure-.pgpass-for-the-default-postgresql-database?) - [How to Run the Application With Other Profiles, e.g. production](#)
- [How to Run the Tests Against a Local User-Space Podman Daemon?](#how-to-run-the-tests-against-a-local-user-space-podman-daemon?) - [How to Do a Clean Run of the Application](#how-to-do-a-clean-run-of-the-application)
- [Install and Run Podman](#install-and-run-podman) - [How to Configure .pgpass for the Default PostgreSQL Database?](#how-to-configure-.pgpass-for-the-default-postgresql-database?)
- [Use the Command Line to Run the Tests Against the Podman Daemon ](#use-the-command-line-to-run-the-tests-against-the-podman-daemon-) - [How to Run the Tests Against a Local User-Space Podman Daemon?](#how-to-run-the-tests-against-a-local-user-space-podman-daemon?)
- [Use IntelliJ IDEA Run the Tests Against the Podman Daemon](#use-intellij-idea-run-the-tests-against-the-podman-daemon) - [Install and Run Podman](#install-and-run-podman)
- [~/.testcontainers.properties](#~/.testcontainers.properties) - [Use the Command Line to Run the Tests Against the Podman Daemon ](#use-the-command-line-to-run-the-tests-against-the-podman-daemon-)
- [How to Run the Tests Against a Remote Podman or Docker Daemon?](#how-to-run-the-tests-against-a-remote-podman-or-docker-daemon?) - [Use IntelliJ IDEA Run the Tests Against the Podman Daemon](#use-intellij-idea-run-the-tests-against-the-podman-daemon)
- [How to Run the Application on a Different Port?](#how-to-run-the-application-on-a-different-port?) - [~/.testcontainers.properties](#~/.testcontainers.properties)
- [How to Use a Persistent Database for Integration Tests?](#how-to-use-a-persistent-database-for-integration-tests?) - [How to Run the Tests Against a Remote Podman or Docker Daemon?](#how-to-run-the-tests-against-a-remote-podman-or-docker-daemon?)
- [How to Amend Liquibase SQL Changesets?](#how-to-amend-liquibase-sql-changesets?) - [How to Run the Application on a Different Port?](#how-to-run-the-application-on-a-different-port?)
- [How to Re-Generate Spring-Controller-Interfaces from OpenAPI specs?](#how-to-re-generate-spring-controller-interfaces-from-openapi-specs?) - [How to Use a Persistent Database for Integration Tests?](#how-to-use-a-persistent-database-for-integration-tests?)
- [How to Generate Database Table Diagrams?](#how-to-generate-database-table-diagrams?) - [How to Amend Liquibase SQL Changesets?](#how-to-amend-liquibase-sql-changesets?)
- [How to Re-Generate Spring-Controller-Interfaces from OpenAPI specs?](#how-to-re-generate-spring-controller-interfaces-from-openapi-specs?)
- [How to Generate Database Table Diagrams?](#how-to-generate-database-table-diagrams?)
- [How to Add (Real) Admin Users](#how-to-add-(real)-admin-users)
- [Further Documentation](#further-documentation) - [Further Documentation](#further-documentation)
<!-- generated TOC end. --> <!-- generated TOC end. -->
@ -51,10 +58,11 @@ Everything is tested on _Ubuntu Linux 22.04_ and _MacOS Monterey (12.4)_.
To be able to build and run the Java Spring Boot application, you need the following tools: To be able to build and run the Java Spring Boot application, you need the following tools:
- Docker 20.x (on MacOS you also need *Docker Desktop* or similar) or Podman - Docker 20.x (on MacOS you also need *Docker Desktop* or similar) or Podman
- optionally: PostgreSQL Server 15.5-bookworm - optionally: PostgreSQL Server 15.5-bookworm, if you want to use the database directly, not just via Docker
(see instructions below to install and run in Docker) (see instructions below to install and run in Docker)
- The matching Java JDK at will be automatically installed by Gradle toolchain support to `~/.gradle/jdks/`. - The matching Java JDK at will be automatically installed by Gradle toolchain support to `~/.gradle/jdks/`.
- You also might need an IDE (e.g. *IntelliJ IDEA* or *Eclipse* or *VS Code* with *[STS](https://spring.io/tools)* and a GUI Frontend for *PostgreSQL* like *Postbird*. - You also might need an IDE (e.g. *IntelliJ IDEA* or *Eclipse* or *VS Code* with *[STS](https://spring.io/tools)* and a GUI Frontend for *PostgreSQL* like *Postbird*.
- Python 3 is expected in /usr/bin/python3 if you want to run the `howto` tool (see `bin/howto`)
If you have at least Docker and the Java JDK installed in appropriate versions and in your `PATH`, then you can start like this: If you have at least Docker and the Java JDK installed in appropriate versions and in your `PATH`, then you can start like this:
@ -64,7 +72,12 @@ If you have at least Docker and the Java JDK installed in appropriate versions a
gw # initially downloads the configured Gradle version into the project gw # initially downloads the configured Gradle version into the project
gw test # compiles and runs unit- and integration-tests - takes >10min even on a fast machine gw test # compiles and runs unit- and integration-tests - takes >10min even on a fast machine
gw scenarioTests # compiles and scenario-tests - takes ~1min on a decent machine # `gw test` does NOT run import- and scenario-tests.
# Use `gw-test` instead to make sure .tc-environment is sourced.
gw scenarioTest # compiles and scenario-tests - takes ~1min on a decent machine
# Use `gw-test scenarioTest` instead to make sure .tc-environment is sourced.
howto test # shows more test information about how to run tests
# if the container has not been built yet, run this: # if the container has not been built yet, run this:
pg-sql-run # downloads + runs PostgreSQL in a Docker container on localhost:5432 pg-sql-run # downloads + runs PostgreSQL in a Docker container on localhost:5432
@ -72,12 +85,22 @@ If you have at least Docker and the Java JDK installed in appropriate versions a
# if the container has been built already and you want to keep the data, run this: # if the container has been built already and you want to keep the data, run this:
pg-sql-start pg-sql-start
Next, compile and run the application without CAS-authentication on `localhost:8080`: Next, compile and run the application on `localhost:8080` and the management server on `localhost:8081`:
# this disables CAS-authentication, for using the REST-API with CAS-authentication, see `bin/cas-curl`.
export HSADMINNG_CAS_SERVER= export HSADMINNG_CAS_SERVER=
gw bootRun
For using the REST-API with CAS-authentication, see `bin/cas-curl`. # this runs the application with test-data and all modules:
gw bootRun --args='--spring.profiles.active=dev,complete,test-data'
The meaning of these profiles is:
- **dev**: the PostgreSQL users are created via Liquibase
- **complete**: all modules are started
- **test-data**: some test data inserted
Running just `gw bootRun` would just run the *office* module, not insert any test-data and
require the PostgreSQL users created in the database (see env-vars in `.aliases`).
Now we can access the REST API, e.g. using curl: Now we can access the REST API, e.g. using curl:
@ -189,7 +212,7 @@ To generate the TOC (Table of Contents), a little bash script from a
Given this is in PATH as `md-toc`, use: Given this is in PATH as `md-toc`, use:
```shell ```shell
md-toc <README.md 2 4 | cut -c5-' md-toc <README.md 2 4 | cut -c5-
``` ```
To render the Markdown files, especially to watch embedded PlantUML diagrams, you can use one of the following methods: To render the Markdown files, especially to watch embedded PlantUML diagrams, you can use one of the following methods:
@ -427,36 +450,42 @@ Some of these rules are checked with *ArchUnit* unit tests.
### Run Tests from Command Line ### Run Tests from Command Line
Run all tests which have not yet been passed with the current source code: Run all unit-, integration- and acceptance-tests which have not yet been passed with the current source code:
```shell ```shell
gw test gw test # uses the current environment, especially HSADMINNG_POSTGRES_JDBC_URL
```
If the referenced database is not empty, the tests might fail.
To explicitly use the Testcontainers-environment, run:
```shell
gw-test # uses the environment from .tc-environment
``` ```
Force running all tests: Force running all tests:
```shell ```shell
gw cleanTest test gw-test --rerun
``` ```
To find more options about running tests, try `howto test`.
### Spotless Code Formatting ### Spotless Code Formatting
Code formatting for Java is checked via *spotless*. Code formatting for Java is checked via *spotless*.
The formatting style can be checked with this command:
```shell
gw spotlessCheck
```
This task is also included in `gw build` and `gw check`.
To apply formatting rules, use: To apply formatting rules, use:
```shell ```shell
gw spotlessApply gw-spotless
``` ```
The gradle task spotlessCheck is also included in `gw build` and `gw check`,
thus if the formatting is not compliant to the rules, the build is going to fail.
### JaCoCo Test Code Coverage Check ### JaCoCo Test Code Coverage Check
This project uses the JaCoCo test code coverage report with limit checks. This project uses the JaCoCo test code coverage report with limit checks.
@ -498,9 +527,8 @@ This task is also executed as part of `gw check`.
#### Remark #### Remark
In this project, there is little business logic in *Java* code; In this project, there is a large amount of code is in *plsql*, especially for RBAC.
most business code is in *plsql* *Java* ist mostly used for mapping and validating REST calls to database queries.
and *Java* ist mostly used for mapping REST calls to database queries.
This mapping ist mostly done through *Spring* annotations and other implicit code. This mapping ist mostly done through *Spring* annotations and other implicit code.
Therefore, there are only few unit tests and thus mutation testing has limited value. Therefore, there are only few unit tests and thus mutation testing has limited value.
@ -593,7 +621,8 @@ and would not need the `rbac.role` table anymore.
We would also reduce the depth of the expensive recursive CTE-query. We would also reduce the depth of the expensive recursive CTE-query.
This has to be explored further. This has to be explored further.
For now, we just keep it in mind and For now, we just keep it in mind and FIXME
### The Mapper is Error-Prone ### The Mapper is Error-Prone
@ -622,6 +651,31 @@ also try this (assumed you've sourced .aliases):
howto howto
``` ```
### How to Run the Application With Other Profiles, e.g. production:
Add `--args='--spring.profiles.active=...` with the wanted profile selector:
```sh
gw bootRun --args='--spring.profiles.active=external-db,only -office,without-test-data'
```
These profiles mean:
- **external-db**: an external PostgreSQL database is used with the PostgreSQL users already created as specified in the environment
- **only-office**: only the Office module is started, but neither the Booking nor the Hosting modules
- **without-test-data**: no test-data is inserted
### How to Do a Clean Run of the Application
If you frequently need to run with a fresh database and a clean build, you can use this:
```sh
export HSADMINNG_CAS_SERVER=
gw clean && pg-sql-reset && sleep 5 && gw bootRun' 2>&1 | tee log
```
### How to Configure .pgpass for the Default PostgreSQL Database? ### How to Configure .pgpass for the Default PostgreSQL Database?
To access the default database schema as used during development, add this line to your `.pgpass` file in your users home directory: To access the default database schema as used during development, add this line to your `.pgpass` file in your users home directory:

View File

@ -83,7 +83,8 @@ dependencies {
compileOnly 'org.projectlombok:lombok' compileOnly 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok' testCompileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools' // TODO.impl: version conflict with SpringDoc, check later and re-enable if fixed
// developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok' testAnnotationProcessor 'org.projectlombok:lombok'
@ -179,7 +180,9 @@ openapiProcessor {
} }
} }
sourceSets.main.java.srcDir 'build/generated/sources/openapi' sourceSets.main.java.srcDir 'build/generated/sources/openapi'
abstract class ProcessSpring extends DefaultTask {} abstract class ProcessSpring extends DefaultTask {}
tasks.register('processSpring', ProcessSpring) tasks.register('processSpring', ProcessSpring)
['processSpringRoot', ['processSpringRoot',
'processSpringRbac', 'processSpringRbac',
@ -253,19 +256,21 @@ licenseReport {
} }
project.tasks.check.dependsOn(checkLicense) project.tasks.check.dependsOn(checkLicense)
// JaCoCo Test Code Coverage // HOWTO: run all tests except import- and scenario-tests: gw test
jacoco {
toolVersion = "0.8.10"
}
test { test {
finalizedBy jacocoTestReport // generate report after tests finalizedBy jacocoTestReport // generate report after tests
excludes = [ excludes = [
'net.hostsharing.hsadminng.**.generated.**', 'net.hostsharing.hsadminng.**.generated.**',
] ]
useJUnitPlatform { useJUnitPlatform {
excludeTags 'importOfficeData', 'importHostingData', 'scenarioTest' excludeTags 'importOfficeData', 'importHostingAssets', 'scenarioTest'
} }
} }
// JaCoCo Test Code Coverage for unit-tests
jacoco {
toolVersion = "0.8.10"
}
jacocoTestReport { jacocoTestReport {
dependsOn test dependsOn test
afterEvaluate { afterEvaluate {
@ -330,6 +335,67 @@ jacocoTestCoverageVerification {
} }
} }
// HOWTO: run all unit-tests which don't need a database: gw unitTest
tasks.register('unitTest', Test) {
useJUnitPlatform {
excludeTags 'importOfficeData', 'importHostingAssets', 'scenarioTest', 'generalIntegrationTest',
'officeIntegrationTest', 'bookingIntegrationTest', 'hostingIntegrationTest'
}
group 'verification'
description 'runs all unit-tests which do not need a database'
mustRunAfter spotlessJava
}
// HOWTO: run all integration tests which are not specific to a module, like base, rbac, config etc.
tasks.register('generalIntegrationTest', Test) {
useJUnitPlatform {
includeTags 'generalIntegrationTest'
}
group 'verification'
description 'runs integration tests which are not specific to a module, like base, rbac, config etc.'
mustRunAfter spotlessJava
}
// HOWTO: run all integration tests of the office module: gw officeIntegrationTest
tasks.register('officeIntegrationTest', Test) {
useJUnitPlatform {
includeTags 'officeIntegrationTest'
}
group 'verification'
description 'runs integration tests of the office module'
mustRunAfter spotlessJava
}
// HOWTO: run all integration tests of the booking module: gw bookingIntegrationTest
tasks.register('bookingIntegrationTest', Test) {
useJUnitPlatform {
includeTags 'bookingIntegrationTest'
}
group 'verification'
description 'runs integration tests of the office module'
mustRunAfter spotlessJava
}
// HOWTO: run all integration tests of the hosting module: gw hostingIntegrationTest
tasks.register('hostingIntegrationTest', Test) {
useJUnitPlatform {
includeTags 'hostingIntegrationTest'
}
group 'verification'
description 'runs integration tests of the office module'
mustRunAfter spotlessJava
}
tasks.register('importOfficeData', Test) { tasks.register('importOfficeData', Test) {
useJUnitPlatform { useJUnitPlatform {
includeTags 'importOfficeData' includeTags 'importOfficeData'
@ -352,7 +418,7 @@ tasks.register('importHostingAssets', Test) {
mustRunAfter spotlessJava mustRunAfter spotlessJava
} }
tasks.register('scenarioTests', Test) { tasks.register('scenarioTest', Test) {
useJUnitPlatform { useJUnitPlatform {
includeTags 'scenarioTest' includeTags 'scenarioTest'
} }
@ -373,7 +439,7 @@ pitest {
] ]
targetTests = ['net.hostsharing.hsadminng.**.*UnitTest', 'net.hostsharing.hsadminng.**.*RestTest'] targetTests = ['net.hostsharing.hsadminng.**.*UnitTest', 'net.hostsharing.hsadminng.**.*RestTest']
excludedTestClasses = ['**AcceptanceTest*', '**IntegrationTest*'] excludedTestClasses = ['**AcceptanceTest*', '**IntegrationTest*', '**ImportOfficeData', '**ImportHostingAssets']
pitestVersion = '1.17.0' pitestVersion = '1.17.0'
junit5PluginVersion = '1.1.0' junit5PluginVersion = '1.1.0'
@ -452,7 +518,7 @@ tasks.register('convertMarkdownToHtml') {
} }
} }
} }
convertMarkdownToHtml.dependsOn scenarioTests convertMarkdownToHtml.dependsOn scenarioTest
// shortcut for compiling all files // shortcut for compiling all files
tasks.register('compile') { tasks.register('compile') {

View File

@ -0,0 +1,105 @@
package net.hostsharing.hsadminng.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.endpoint.SanitizableData;
import org.springframework.boot.actuate.endpoint.SanitizingFunction;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
// HOWTO: exclude sensitive values, like passwords and other secrets, from being show by actuator endpoints:
// either use: add your custom keys to management.endpoint.additionalKeysToSanitize,
// or, if you need more heuristics, amend this code down here.
@Component
public class ActuatorSanitizer implements SanitizingFunction {
private static final String[] REGEX_PARTS = {"*", "$", "^", "+"};
private static final Set<String> DEFAULT_KEYS_TO_SANITIZE = Set.of(
"password", "secret", "token", ".*credentials.*", "vcap_services", "^vcap\\.services.*$", "sun.java.command", "^spring[._]application[._]json$"
);
private static final Set<String> URI_USERINFO_KEYS = Set.of(
"uri", "uris", "url", "urls", "address", "addresses"
);
private static final Pattern URI_USERINFO_PATTERN = Pattern.compile("^\\[?[A-Za-z][A-Za-z0-9\\+\\.\\-]+://.+:(.*)@.+$");
private final List<Pattern> keysToSanitize = new ArrayList<>();
public ActuatorSanitizer(@Value("${management.endpoint.additionalKeysToSanitize:}") final List<String> additionalKeysToSanitize) {
addKeysToSanitize(DEFAULT_KEYS_TO_SANITIZE);
addKeysToSanitize(URI_USERINFO_KEYS);
addKeysToSanitize(additionalKeysToSanitize);
}
@Override
public SanitizableData apply(final SanitizableData data) {
if (data.getValue() == null) {
return data;
}
for (final Pattern pattern : keysToSanitize) {
if (pattern.matcher(data.getKey()).matches()) {
if (keyIsUriWithUserInfo(pattern)) {
return data.withValue(sanitizeUris(data.getValue().toString()));
}
return data.withValue(SanitizableData.SANITIZED_VALUE);
}
}
return data;
}
private void addKeysToSanitize(final Collection<String> keysToSanitize) {
for (final String key : keysToSanitize) {
this.keysToSanitize.add(getPattern(key));
}
}
private Pattern getPattern(final String value) {
if (isRegex(value)) {
return Pattern.compile(value, Pattern.CASE_INSENSITIVE);
}
return Pattern.compile(".*" + value + "$", Pattern.CASE_INSENSITIVE);
}
private boolean isRegex(final String value) {
for (final String part : REGEX_PARTS) {
if (value.contains(part)) {
return true;
}
}
return false;
}
private boolean keyIsUriWithUserInfo(final Pattern pattern) {
for (String uriKey : URI_USERINFO_KEYS) {
if (pattern.matcher(uriKey).matches()) {
return true;
}
}
return false;
}
private Object sanitizeUris(final String value) {
return Arrays.stream(value.split(",")).map(this::sanitizeUri).collect(Collectors.joining(","));
}
private String sanitizeUri(final String value) {
final var matcher = URI_USERINFO_PATTERN.matcher(value);
final var password = matcher.matches() ? matcher.group(1) : null;
if (password != null) {
return StringUtils.replace(value, ":" + password + "@", ":" + SanitizableData.SANITIZED_VALUE + "@");
}
return value;
}
}

View File

@ -2,12 +2,14 @@ package net.hostsharing.hsadminng.hs.booking.debitor;
import io.micrometer.core.annotation.Timed; import io.micrometer.core.annotation.Timed;
import org.springframework.data.repository.Repository; import org.springframework.data.repository.Repository;
import org.springframework.context.annotation.Profile;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.UUID; import java.util.UUID;
public interface HsBookingDebitorRepository extends Repository<HsBookingDebitorEntity, UUID> { @Profile("!only-office")
public interface HsBookingDebitorRepository extends Repository<HsBookingDebitorEntity, UUID> {
@Timed("app.booking.debitor.repo.findByUuid") @Timed("app.booking.debitor.repo.findByUuid")
Optional<HsBookingDebitorEntity> findByUuid(UUID id); Optional<HsBookingDebitorEntity> findByUuid(UUID id);

View File

@ -1,10 +1,12 @@
package net.hostsharing.hsadminng.hs.booking.item; package net.hostsharing.hsadminng.hs.booking.item;
import io.micrometer.core.annotation.Timed; import io.micrometer.core.annotation.Timed;
import org.springframework.context.annotation.Profile;
import org.springframework.data.repository.Repository; import org.springframework.data.repository.Repository;
import java.util.UUID; import java.util.UUID;
@Profile("!only-office")
public interface BookingItemCreatedEventRepository extends Repository<BookingItemCreatedEventEntity, UUID> { public interface BookingItemCreatedEventRepository extends Repository<BookingItemCreatedEventEntity, UUID> {
@Timed("app.booking.items.repo.save") @Timed("app.booking.items.repo.save")

View File

@ -16,6 +16,7 @@ import net.hostsharing.hsadminng.mapper.StrictMapper;
import net.hostsharing.hsadminng.persistence.EntityManagerWrapper; import net.hostsharing.hsadminng.persistence.EntityManagerWrapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.annotation.Profile;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -30,6 +31,7 @@ import static java.util.Optional.ofNullable;
import static net.hostsharing.hsadminng.mapper.PostgresDateRange.toPostgresDateRange; import static net.hostsharing.hsadminng.mapper.PostgresDateRange.toPostgresDateRange;
@RestController @RestController
@Profile("!only-office")
public class HsBookingItemController implements HsBookingItemsApi { public class HsBookingItemController implements HsBookingItemsApi {
@Autowired @Autowired

View File

@ -1,12 +1,14 @@
package net.hostsharing.hsadminng.hs.booking.item; package net.hostsharing.hsadminng.hs.booking.item;
import io.micrometer.core.annotation.Timed; import io.micrometer.core.annotation.Timed;
import org.springframework.context.annotation.Profile;
import org.springframework.data.repository.Repository; import org.springframework.data.repository.Repository;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.UUID; import java.util.UUID;
@Profile("!only-office")
public interface HsBookingItemRbacRepository extends HsBookingItemRepository<HsBookingItemRbacEntity>, public interface HsBookingItemRbacRepository extends HsBookingItemRepository<HsBookingItemRbacEntity>,
Repository<HsBookingItemRbacEntity, UUID> { Repository<HsBookingItemRbacEntity, UUID> {

View File

@ -1,12 +1,14 @@
package net.hostsharing.hsadminng.hs.booking.item; package net.hostsharing.hsadminng.hs.booking.item;
import io.micrometer.core.annotation.Timed; import io.micrometer.core.annotation.Timed;
import org.springframework.context.annotation.Profile;
import org.springframework.data.repository.Repository; import org.springframework.data.repository.Repository;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.UUID; import java.util.UUID;
@Profile("!only-office")
public interface HsBookingItemRealRepository extends HsBookingItemRepository<HsBookingItemRealEntity>, public interface HsBookingItemRealRepository extends HsBookingItemRepository<HsBookingItemRealEntity>,
Repository<HsBookingItemRealEntity, UUID> { Repository<HsBookingItemRealEntity, UUID> {

View File

@ -1,10 +1,13 @@
package net.hostsharing.hsadminng.hs.booking.item; package net.hostsharing.hsadminng.hs.booking.item;
import org.springframework.context.annotation.Profile;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.UUID; import java.util.UUID;
@Profile("!only-office")
public interface HsBookingItemRepository<E extends HsBookingItem> { public interface HsBookingItemRepository<E extends HsBookingItem> {
Optional<E> findByUuid(final UUID bookingItemUuid); Optional<E> findByUuid(final UUID bookingItemUuid);

View File

@ -9,6 +9,7 @@ import net.hostsharing.hsadminng.hs.booking.generated.api.v1.model.HsBookingProj
import net.hostsharing.hsadminng.hs.booking.generated.api.v1.model.HsBookingProjectResource; import net.hostsharing.hsadminng.hs.booking.generated.api.v1.model.HsBookingProjectResource;
import net.hostsharing.hsadminng.mapper.StrictMapper; import net.hostsharing.hsadminng.mapper.StrictMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -20,6 +21,7 @@ import java.util.UUID;
import java.util.function.BiConsumer; import java.util.function.BiConsumer;
@RestController @RestController
@Profile("!only-office")
public class HsBookingProjectController implements HsBookingProjectsApi { public class HsBookingProjectController implements HsBookingProjectsApi {
@Autowired @Autowired

View File

@ -1,12 +1,14 @@
package net.hostsharing.hsadminng.hs.booking.project; package net.hostsharing.hsadminng.hs.booking.project;
import io.micrometer.core.annotation.Timed; import io.micrometer.core.annotation.Timed;
import org.springframework.context.annotation.Profile;
import org.springframework.data.repository.Repository; import org.springframework.data.repository.Repository;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.UUID; import java.util.UUID;
@Profile("!only-office")
public interface HsBookingProjectRbacRepository extends HsBookingProjectRepository<HsBookingProjectRbacEntity>, public interface HsBookingProjectRbacRepository extends HsBookingProjectRepository<HsBookingProjectRbacEntity>,
Repository<HsBookingProjectRbacEntity, UUID> { Repository<HsBookingProjectRbacEntity, UUID> {

View File

@ -1,12 +1,14 @@
package net.hostsharing.hsadminng.hs.booking.project; package net.hostsharing.hsadminng.hs.booking.project;
import io.micrometer.core.annotation.Timed; import io.micrometer.core.annotation.Timed;
import org.springframework.context.annotation.Profile;
import org.springframework.data.repository.Repository; import org.springframework.data.repository.Repository;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.UUID; import java.util.UUID;
@Profile("!only-office")
public interface HsBookingProjectRealRepository extends HsBookingProjectRepository<HsBookingProjectRealEntity>, public interface HsBookingProjectRealRepository extends HsBookingProjectRepository<HsBookingProjectRealEntity>,
Repository<HsBookingProjectRealEntity, UUID> { Repository<HsBookingProjectRealEntity, UUID> {

View File

@ -1,11 +1,13 @@
package net.hostsharing.hsadminng.hs.booking.project; package net.hostsharing.hsadminng.hs.booking.project;
import io.micrometer.core.annotation.Timed; import io.micrometer.core.annotation.Timed;
import org.springframework.context.annotation.Profile;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.UUID; import java.util.UUID;
@Profile("!only-office")
public interface HsBookingProjectRepository<E extends HsBookingProject> { public interface HsBookingProjectRepository<E extends HsBookingProject> {
@Timed("app.booking.projects.repo.findByUuid") @Timed("app.booking.projects.repo.findByUuid")

View File

@ -15,6 +15,7 @@ import net.hostsharing.hsadminng.mapper.KeyValueMap;
import net.hostsharing.hsadminng.mapper.StrictMapper; import net.hostsharing.hsadminng.mapper.StrictMapper;
import net.hostsharing.hsadminng.persistence.EntityManagerWrapper; import net.hostsharing.hsadminng.persistence.EntityManagerWrapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -27,6 +28,7 @@ import java.util.UUID;
import java.util.function.BiConsumer; import java.util.function.BiConsumer;
@RestController @RestController
@Profile("!only-office")
public class HsHostingAssetController implements HsHostingAssetsApi { public class HsHostingAssetController implements HsHostingAssetsApi {
@Autowired @Autowired

View File

@ -4,6 +4,7 @@ import io.micrometer.core.annotation.Timed;
import net.hostsharing.hsadminng.hs.hosting.asset.validators.HostingAssetEntityValidatorRegistry; import net.hostsharing.hsadminng.hs.hosting.asset.validators.HostingAssetEntityValidatorRegistry;
import net.hostsharing.hsadminng.hs.hosting.generated.api.v1.api.HsHostingAssetPropsApi; import net.hostsharing.hsadminng.hs.hosting.generated.api.v1.api.HsHostingAssetPropsApi;
import net.hostsharing.hsadminng.hs.hosting.generated.api.v1.model.HsHostingAssetTypeResource; import net.hostsharing.hsadminng.hs.hosting.generated.api.v1.model.HsHostingAssetTypeResource;
import org.springframework.context.annotation.Profile;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -12,6 +13,7 @@ import java.util.Map;
@RestController @RestController
@Profile("!only-office")
public class HsHostingAssetPropsController implements HsHostingAssetPropsApi { public class HsHostingAssetPropsController implements HsHostingAssetPropsApi {
@Override @Override

View File

@ -1,6 +1,7 @@
package net.hostsharing.hsadminng.hs.hosting.asset; package net.hostsharing.hsadminng.hs.hosting.asset;
import io.micrometer.core.annotation.Timed; import io.micrometer.core.annotation.Timed;
import org.springframework.context.annotation.Profile;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository; import org.springframework.data.repository.Repository;
@ -8,7 +9,7 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.UUID; import java.util.UUID;
@Profile("!only-office")
public interface HsHostingAssetRbacRepository extends HsHostingAssetRepository<HsHostingAssetRbacEntity>, Repository<HsHostingAssetRbacEntity, UUID> { public interface HsHostingAssetRbacRepository extends HsHostingAssetRepository<HsHostingAssetRbacEntity>, Repository<HsHostingAssetRbacEntity, UUID> {
@Timed("app.hostingAsset.repo.findByUuid.rbac") @Timed("app.hostingAsset.repo.findByUuid.rbac")

View File

@ -1,6 +1,7 @@
package net.hostsharing.hsadminng.hs.hosting.asset; package net.hostsharing.hsadminng.hs.hosting.asset;
import io.micrometer.core.annotation.Timed; import io.micrometer.core.annotation.Timed;
import org.springframework.context.annotation.Profile;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository; import org.springframework.data.repository.Repository;
@ -9,6 +10,7 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.UUID; import java.util.UUID;
@Profile("!only-office")
public interface HsHostingAssetRealRepository extends HsHostingAssetRepository<HsHostingAssetRealEntity>, Repository<HsHostingAssetRealEntity, UUID> { public interface HsHostingAssetRealRepository extends HsHostingAssetRepository<HsHostingAssetRealEntity>, Repository<HsHostingAssetRealEntity, UUID> {
@Timed("app.hostingAsset.repo.findByUuid.real") @Timed("app.hostingAsset.repo.findByUuid.real")

View File

@ -1,11 +1,13 @@
package net.hostsharing.hsadminng.hs.hosting.asset; package net.hostsharing.hsadminng.hs.hosting.asset;
import io.micrometer.core.annotation.Timed; import io.micrometer.core.annotation.Timed;
import org.springframework.context.annotation.Profile;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.UUID; import java.util.UUID;
@Profile("!only-office")
public interface HsHostingAssetRepository<E extends HsHostingAsset> { public interface HsHostingAssetRepository<E extends HsHostingAsset> {
@Timed("app.hosting.assets.repo.findByUuid") @Timed("app.hosting.assets.repo.findByUuid")

View File

@ -13,9 +13,11 @@ import net.hostsharing.hsadminng.mapper.StrictMapper;
import net.hostsharing.hsadminng.persistence.EntityManagerWrapper; import net.hostsharing.hsadminng.persistence.EntityManagerWrapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener; import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@Component @Component
@Profile("!only-office")
public class HsBookingItemCreatedListener implements ApplicationListener<BookingItemCreatedAppEvent> { public class HsBookingItemCreatedListener implements ApplicationListener<BookingItemCreatedAppEvent> {
@Autowired @Autowired

View File

@ -8,17 +8,33 @@ management:
endpoints: endpoints:
web: web:
exposure: exposure:
# HOWTO: view _clickable_ Spring Actuator (Micrometer) Metrics endpoints: http://localhost:8081/actuator/metric-links # HOWTO: view _clickable_ Spring Actuator (Micrometer) Metrics endpoints:
include: info, health, metrics, metric-links, mappings, openapi, swaggerui # http://localhost:8081/actuator/metric-links
# HOWTO: view all configured endpoints of the running application:
# http://localhost:8081/actuator/mappings
# HOWTO: view the effective application configuration properties:
# http://localhost:8081/actuator/configprops
include: info, health, metrics, metric-links, mappings, openapi, swaggerui, configprops, env
endpoint:
env:
# TODO.spec: check this, maybe set to when_authorized?
show-values: always
configprops:
# TODO.spec: check this, maybe set to when_authorized?
show-values: always
observations: observations:
annotations: annotations:
enabled: true enabled: true
spring: spring:
datasource: datasource:
driver-class-name: org.postgresql.Driver driver-class-name: org.postgresql.Driver
password: password password: password
url: jdbc:postgresql://localhost:5432/postgres url: ${HSADMINNG_POSTGRES_JDBC_URL}
username: postgres username: postgres
sql: sql:
@ -30,13 +46,13 @@ spring:
hibernate: hibernate:
dialect: net.hostsharing.hsadminng.config.PostgresCustomDialect dialect: net.hostsharing.hsadminng.config.PostgresCustomDialect
liquibase:
contexts: ${spring.profiles.active}
# keep this in sync with test/.../application.yml # keep this in sync with test/.../application.yml
springdoc: springdoc:
use-management-port: true use-management-port: true
liquibase:
contexts: dev
hsadminng: hsadminng:
postgres: postgres:
leakproof: leakproof:
@ -50,4 +66,3 @@ metrics:
http: http:
server: server:
requests: true requests: true

View File

@ -870,7 +870,7 @@ $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:rbac-base-PGSQL-ROLES context:dev,tc endDelimiter:--// --changeset michael.hoennig:rbac-base-PGSQL-ROLES context:!external-db endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
do $$ do $$

View File

@ -170,7 +170,7 @@ commit;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:rbac-global-ADMIN-USERS context:dev,tc endDelimiter:--// --changeset michael.hoennig:rbac-global-ADMIN-USERS context:!without-test-data endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
/* /*
Create two users and assign both to the administrators' role. Create two users and assign both to the administrators' role.
@ -192,7 +192,7 @@ $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:rbac-global-TEST context:dev,tc runAlways:true endDelimiter:--// --changeset michael.hoennig:rbac-global-TEST context:!without-test-data runAlways:true endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
/* /*

View File

@ -67,7 +67,7 @@ end; $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:test-customer-TEST-DATA-GENERATION context=dev,tc endDelimiter:--// --changeset michael.hoennig:test-customer-TEST-DATA-GENERATION context:!without-test-data endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
do language plpgsql $$ do language plpgsql $$

View File

@ -59,7 +59,7 @@ $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:test-package-TEST-DATA-GENERATION context=dev,tc endDelimiter:--// --changeset michael.hoennig:test-package-TEST-DATA-GENERATION context:!without-test-data endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
do language plpgsql $$ do language plpgsql $$

View File

@ -52,7 +52,7 @@ end; $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:hs-domain-TEST-DATA-GENERATION context=dev,tc endDelimiter:--// --changeset michael.hoennig:hs-domain-TEST-DATA-GENERATION context:!without-test-data endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
do language plpgsql $$ do language plpgsql $$

View File

@ -55,7 +55,7 @@ end; $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:hs-office-contact-TEST-DATA-GENERATION context=dev,tc endDelimiter:--// --changeset michael.hoennig:hs-office-contact-TEST-DATA-GENERATION context:!without-test-data endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
do language plpgsql $$ do language plpgsql $$

View File

@ -34,7 +34,7 @@ end; $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:hs-office-person-TEST-DATA-GENERATION context=dev,tc endDelimiter:--// --changeset michael.hoennig:hs-office-person-TEST-DATA-GENERATION context:!without-test-data endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
do language plpgsql $$ do language plpgsql $$

View File

@ -80,7 +80,7 @@ end; $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:hs-office-relation-TEST-DATA-GENERATION context=dev,tc endDelimiter:--// --changeset michael.hoennig:hs-office-relation-TEST-DATA-GENERATION context:!without-test-data endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
do language plpgsql $$ do language plpgsql $$

View File

@ -66,7 +66,7 @@ end; $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:hs-office-partner-TEST-DATA-GENERATION context=dev,tc endDelimiter:--// --changeset michael.hoennig:hs-office-partner-TEST-DATA-GENERATION context:!without-test-data endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
do language plpgsql $$ do language plpgsql $$

View File

@ -26,7 +26,7 @@ end; $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:hs-office-bankaccount-TEST-DATA-GENERATION context=dev,tc endDelimiter:--// --changeset michael.hoennig:hs-office-bankaccount-TEST-DATA-GENERATION context:!without-test-data endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
do language plpgsql $$ do language plpgsql $$

View File

@ -45,7 +45,7 @@ end; $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:hs-office-debitor-TEST-DATA-GENERATION context=dev,tc endDelimiter:--// --changeset michael.hoennig:hs-office-debitor-TEST-DATA-GENERATION context:!without-test-data endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
do language plpgsql $$ do language plpgsql $$

View File

@ -38,7 +38,7 @@ end; $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:hs-office-sepaMandate-TEST-DATA-GENERATION context=dev,tc endDelimiter:--// --changeset michael.hoennig:hs-office-sepaMandate-TEST-DATA-GENERATION context:!without-test-data endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
do language plpgsql $$ do language plpgsql $$

View File

@ -28,7 +28,7 @@ end; $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:hs-office-membership-TEST-DATA-GENERATION context=dev,tc endDelimiter:--// --changeset michael.hoennig:hs-office-membership-TEST-DATA-GENERATION context:!without-test-data endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
do language plpgsql $$ do language plpgsql $$

View File

@ -38,7 +38,7 @@ end; $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:hs-office-coopSharesTransaction-TEST-DATA-GENERATION context=dev,tc endDelimiter:--// --changeset michael.hoennig:hs-office-coopSharesTransaction-TEST-DATA-GENERATION context:!without-test-data endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
do language plpgsql $$ do language plpgsql $$

View File

@ -44,7 +44,7 @@ end; $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:hs-office-coopAssetsTransaction-TEST-DATA-GENERATION context=dev,tc endDelimiter:--// --changeset michael.hoennig:hs-office-coopAssetsTransaction-TEST-DATA-GENERATION context:!without-test-data endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
do language plpgsql $$ do language plpgsql $$

View File

@ -34,7 +34,7 @@ end; $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:hs-booking-project-TEST-DATA-GENERATION context=dev,tc endDelimiter:--// --changeset michael.hoennig:hs-booking-project-TEST-DATA-GENERATION context:!without-test-data endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
do language plpgsql $$ do language plpgsql $$

View File

@ -40,7 +40,7 @@ end; $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:hs-booking-item-TEST-DATA-GENERATION context=dev,tc endDelimiter:--// --changeset michael.hoennig:hs-booking-item-TEST-DATA-GENERATION context:!without-test-data endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
do language plpgsql $$ do language plpgsql $$

View File

@ -105,7 +105,7 @@ end; $$;
-- ============================================================================ -- ============================================================================
--changeset michael.hoennig:hs-hosting-asset-TEST-DATA-GENERATION context=dev,tc endDelimiter:--// --changeset michael.hoennig:hs-hosting-asset-TEST-DATA-GENERATION context:!without-test-data endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
do language plpgsql $$ do language plpgsql $$

View File

@ -29,6 +29,7 @@ databaseChangeLog:
file: db/changelog/0-base/030-historization.sql file: db/changelog/0-base/030-historization.sql
- include: - include:
file: db/changelog/0-base/090-log-slow-queries-extensions.sql file: db/changelog/0-base/090-log-slow-queries-extensions.sql
- include: - include:
file: db/changelog/1-rbac/1000-rbac-schema.sql file: db/changelog/1-rbac/1000-rbac-schema.sql
- include: - include:
@ -49,26 +50,38 @@ databaseChangeLog:
file: db/changelog/1-rbac/1059-rbac-statistics.sql file: db/changelog/1-rbac/1059-rbac-statistics.sql
- include: - include:
file: db/changelog/1-rbac/1080-rbac-global.sql file: db/changelog/1-rbac/1080-rbac-global.sql
- include: - include:
file: db/changelog/2-rbactest/200-rbactest-schema.sql file: db/changelog/2-rbactest/200-rbactest-schema.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/2-rbactest/201-rbactest-customer/2010-rbactest-customer.sql file: db/changelog/2-rbactest/201-rbactest-customer/2010-rbactest-customer.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/2-rbactest/201-rbactest-customer/2013-rbactest-customer-rbac.sql file: db/changelog/2-rbactest/201-rbactest-customer/2013-rbactest-customer-rbac.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/2-rbactest/201-rbactest-customer/2018-rbactest-customer-test-data.sql file: db/changelog/2-rbactest/201-rbactest-customer/2018-rbactest-customer-test-data.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/2-rbactest/202-rbactest-package/2020-rbactest-package.sql file: db/changelog/2-rbactest/202-rbactest-package/2020-rbactest-package.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/2-rbactest/202-rbactest-package/2023-rbactest-package-rbac.sql file: db/changelog/2-rbactest/202-rbactest-package/2023-rbactest-package-rbac.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/2-rbactest/202-rbactest-package/2028-rbactest-package-test-data.sql file: db/changelog/2-rbactest/202-rbactest-package/2028-rbactest-package-test-data.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/2-rbactest/203-rbactest-domain/2030-rbactest-domain.sql file: db/changelog/2-rbactest/203-rbactest-domain/2030-rbactest-domain.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/2-rbactest/203-rbactest-domain/2033-rbactest-domain-rbac.sql file: db/changelog/2-rbactest/203-rbactest-domain/2033-rbactest-domain-rbac.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/2-rbactest/203-rbactest-domain/2038-rbactest-domain-test-data.sql file: db/changelog/2-rbactest/203-rbactest-domain/2038-rbactest-domain-test-data.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/5-hs-office/500-hs-office-schema.sql file: db/changelog/5-hs-office/500-hs-office-schema.sql
- include: - include:
@ -79,18 +92,21 @@ databaseChangeLog:
file: db/changelog/5-hs-office/501-contact/5016-hs-office-contact-migration.sql file: db/changelog/5-hs-office/501-contact/5016-hs-office-contact-migration.sql
- include: - include:
file: db/changelog/5-hs-office/501-contact/5018-hs-office-contact-test-data.sql file: db/changelog/5-hs-office/501-contact/5018-hs-office-contact-test-data.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/5-hs-office/502-person/5020-hs-office-person.sql file: db/changelog/5-hs-office/502-person/5020-hs-office-person.sql
- include: - include:
file: db/changelog/5-hs-office/502-person/5023-hs-office-person-rbac.sql file: db/changelog/5-hs-office/502-person/5023-hs-office-person-rbac.sql
- include: - include:
file: db/changelog/5-hs-office/502-person/5028-hs-office-person-test-data.sql file: db/changelog/5-hs-office/502-person/5028-hs-office-person-test-data.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/5-hs-office/503-relation/5030-hs-office-relation.sql file: db/changelog/5-hs-office/503-relation/5030-hs-office-relation.sql
- include: - include:
file: db/changelog/5-hs-office/503-relation/5033-hs-office-relation-rbac.sql file: db/changelog/5-hs-office/503-relation/5033-hs-office-relation-rbac.sql
- include: - include:
file: db/changelog/5-hs-office/503-relation/5038-hs-office-relation-test-data.sql file: db/changelog/5-hs-office/503-relation/5038-hs-office-relation-test-data.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/5-hs-office/504-partner/5040-hs-office-partner.sql file: db/changelog/5-hs-office/504-partner/5040-hs-office-partner.sql
- include: - include:
@ -101,18 +117,21 @@ databaseChangeLog:
file: db/changelog/5-hs-office/504-partner/5046-hs-office-partner-migration.sql file: db/changelog/5-hs-office/504-partner/5046-hs-office-partner-migration.sql
- include: - include:
file: db/changelog/5-hs-office/504-partner/5048-hs-office-partner-test-data.sql file: db/changelog/5-hs-office/504-partner/5048-hs-office-partner-test-data.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/5-hs-office/505-bankaccount/5050-hs-office-bankaccount.sql file: db/changelog/5-hs-office/505-bankaccount/5050-hs-office-bankaccount.sql
- include: - include:
file: db/changelog/5-hs-office/505-bankaccount/5053-hs-office-bankaccount-rbac.sql file: db/changelog/5-hs-office/505-bankaccount/5053-hs-office-bankaccount-rbac.sql
- include: - include:
file: db/changelog/5-hs-office/505-bankaccount/5058-hs-office-bankaccount-test-data.sql file: db/changelog/5-hs-office/505-bankaccount/5058-hs-office-bankaccount-test-data.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/5-hs-office/506-debitor/5060-hs-office-debitor.sql file: db/changelog/5-hs-office/506-debitor/5060-hs-office-debitor.sql
- include: - include:
file: db/changelog/5-hs-office/506-debitor/5063-hs-office-debitor-rbac.sql file: db/changelog/5-hs-office/506-debitor/5063-hs-office-debitor-rbac.sql
- include: - include:
file: db/changelog/5-hs-office/506-debitor/5068-hs-office-debitor-test-data.sql file: db/changelog/5-hs-office/506-debitor/5068-hs-office-debitor-test-data.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/5-hs-office/507-sepamandate/5070-hs-office-sepamandate.sql file: db/changelog/5-hs-office/507-sepamandate/5070-hs-office-sepamandate.sql
- include: - include:
@ -121,12 +140,14 @@ databaseChangeLog:
file: db/changelog/5-hs-office/507-sepamandate/5076-hs-office-sepamandate-migration.sql file: db/changelog/5-hs-office/507-sepamandate/5076-hs-office-sepamandate-migration.sql
- include: - include:
file: db/changelog/5-hs-office/507-sepamandate/5078-hs-office-sepamandate-test-data.sql file: db/changelog/5-hs-office/507-sepamandate/5078-hs-office-sepamandate-test-data.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/5-hs-office/510-membership/5100-hs-office-membership.sql file: db/changelog/5-hs-office/510-membership/5100-hs-office-membership.sql
- include: - include:
file: db/changelog/5-hs-office/510-membership/5103-hs-office-membership-rbac.sql file: db/changelog/5-hs-office/510-membership/5103-hs-office-membership-rbac.sql
- include: - include:
file: db/changelog/5-hs-office/510-membership/5108-hs-office-membership-test-data.sql file: db/changelog/5-hs-office/510-membership/5108-hs-office-membership-test-data.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/5-hs-office/511-coopshares/5110-hs-office-coopshares.sql file: db/changelog/5-hs-office/511-coopshares/5110-hs-office-coopshares.sql
- include: - include:
@ -135,6 +156,7 @@ databaseChangeLog:
file: db/changelog/5-hs-office/511-coopshares/5116-hs-office-coopshares-migration.sql file: db/changelog/5-hs-office/511-coopshares/5116-hs-office-coopshares-migration.sql
- include: - include:
file: db/changelog/5-hs-office/511-coopshares/5118-hs-office-coopshares-test-data.sql file: db/changelog/5-hs-office/511-coopshares/5118-hs-office-coopshares-test-data.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/5-hs-office/512-coopassets/5120-hs-office-coopassets.sql file: db/changelog/5-hs-office/512-coopassets/5120-hs-office-coopassets.sql
- include: - include:
@ -143,34 +165,53 @@ databaseChangeLog:
file: db/changelog/5-hs-office/512-coopassets/5126-hs-office-coopassets-migration.sql file: db/changelog/5-hs-office/512-coopassets/5126-hs-office-coopassets-migration.sql
- include: - include:
file: db/changelog/5-hs-office/512-coopassets/5128-hs-office-coopassets-test-data.sql file: db/changelog/5-hs-office/512-coopassets/5128-hs-office-coopassets-test-data.sql
context: "!without-test-data"
- include: - include:
file: db/changelog/6-hs-booking/600-hs-booking-schema.sql file: db/changelog/6-hs-booking/600-hs-booking-schema.sql
context: "!only-office"
- include: - include:
file: db/changelog/6-hs-booking/610-booking-debitor/6100-hs-booking-debitor.sql file: db/changelog/6-hs-booking/610-booking-debitor/6100-hs-booking-debitor.sql
context: "!only-office"
- include: - include:
file: db/changelog/6-hs-booking/620-booking-project/6200-hs-booking-project.sql file: db/changelog/6-hs-booking/620-booking-project/6200-hs-booking-project.sql
context: "!only-office"
- include: - include:
file: db/changelog/6-hs-booking/620-booking-project/6203-hs-booking-project-rbac.sql file: db/changelog/6-hs-booking/620-booking-project/6203-hs-booking-project-rbac.sql
context: "!only-office"
- include: - include:
file: db/changelog/6-hs-booking/620-booking-project/6208-hs-booking-project-test-data.sql file: db/changelog/6-hs-booking/620-booking-project/6208-hs-booking-project-test-data.sql
context: "!only-office and !without-test-data"
- include: - include:
file: db/changelog/6-hs-booking/630-booking-item/6300-hs-booking-item.sql file: db/changelog/6-hs-booking/630-booking-item/6300-hs-booking-item.sql
context: "!only-office"
- include: - include:
file: db/changelog/6-hs-booking/630-booking-item/6303-hs-booking-item-rbac.sql file: db/changelog/6-hs-booking/630-booking-item/6303-hs-booking-item-rbac.sql
context: "!only-office"
- include: - include:
file: db/changelog/6-hs-booking/630-booking-item/6308-hs-booking-item-test-data.sql file: db/changelog/6-hs-booking/630-booking-item/6308-hs-booking-item-test-data.sql
context: "!only-office and !without-test-data"
- include: - include:
file: db/changelog/7-hs-hosting/700-hs-hosting-schema.sql file: db/changelog/7-hs-hosting/700-hs-hosting-schema.sql
context: "!only-office"
- include: - include:
file: db/changelog/7-hs-hosting/701-hosting-asset/7010-hs-hosting-asset.sql file: db/changelog/7-hs-hosting/701-hosting-asset/7010-hs-hosting-asset.sql
context: "!only-office"
- include: - include:
file: db/changelog/7-hs-hosting/701-hosting-asset/7013-hs-hosting-asset-rbac.sql file: db/changelog/7-hs-hosting/701-hosting-asset/7013-hs-hosting-asset-rbac.sql
context: "!only-office"
- include: - include:
file: db/changelog/7-hs-hosting/701-hosting-asset/7016-hs-hosting-asset-migration.sql file: db/changelog/7-hs-hosting/701-hosting-asset/7016-hs-hosting-asset-migration.sql
context: "!only-office"
- include: - include:
file: db/changelog/7-hs-hosting/701-hosting-asset/7018-hs-hosting-asset-test-data.sql file: db/changelog/7-hs-hosting/701-hosting-asset/7018-hs-hosting-asset-test-data.sql
context: "!only-office and !without-test-data"
- include: - include:
file: db/changelog/9-hs-global/9000-statistics.sql file: db/changelog/9-hs-global/9000-statistics.sql
context: "!only-office"
- include: - include:
file: db/changelog/9-hs-global/9100-hs-integration-schema.sql file: db/changelog/9-hs-global/9100-hs-integration-schema.sql
- include: - include:

View File

@ -0,0 +1,95 @@
package net.hostsharing.hsadminng.config;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.endpoint.SanitizableData;
import org.springframework.core.env.PropertySource;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
class ActuatorSanitizerUnitTest {
private ActuatorSanitizer actuatorSanitizer;
@BeforeEach
void setUp() {
// Initialize with additional keys for testing
final var additionalKeys = List.of("customSecret", "^custom[._]regex.*$");
actuatorSanitizer = new ActuatorSanitizer(additionalKeys);
}
@Test
void testSanitizesDefaultKeys() {
final var data = createSanitizableData("password", "my-secret-password");
final var sanitizedData = actuatorSanitizer.apply(data);
assertThat(sanitizedData.getValue()).isEqualTo(SanitizableData.SANITIZED_VALUE);
}
@Test
void testSanitizesCustomKey() {
final var data = createSanitizableData("customSecret", "my-custom-secret");
final var sanitizedData = actuatorSanitizer.apply(data);
assertThat(sanitizedData.getValue()).isEqualTo(SanitizableData.SANITIZED_VALUE);
}
@Test
void testSanitizesCustomRegexKey() {
final var data = createSanitizableData("custom.regex.key", "my-custom-regex-value");
final var sanitizedData = actuatorSanitizer.apply(data);
assertThat(sanitizedData.getValue()).isEqualTo(SanitizableData.SANITIZED_VALUE);
}
@Test
void testSanitizesUriWithUserInfo() {
final var data = createSanitizableData("uri", "http://user:password@host.com");
final var sanitizedData = actuatorSanitizer.apply(data);
assertThat(sanitizedData.getValue()).isEqualTo("http://user:******@host.com");
}
@Test
void testDoesNotSanitizeIrrelevantKey() {
final var data = createSanitizableData("irrelevantKey", "non-sensitive-value");
final var sanitizedData = actuatorSanitizer.apply(data);
assertThat(sanitizedData.getValue()).isEqualTo("non-sensitive-value");
}
@Test
void testHandlesNullValue() {
final var data = createSanitizableData("password", null);
final var sanitizedData = actuatorSanitizer.apply(data);
assertThat(sanitizedData.getValue()).isNull();
}
@Test
void testHandlesMultipleUris() {
final var data = createSanitizableData(
"uris",
"http://user1:password1@host1.com,http://user2:geheim@host2.com,http://user2@host2.com");
final var sanitizedData = actuatorSanitizer.apply(data);
assertThat(sanitizedData.getValue()).isEqualTo(
"http://user1:******@host1.com,http://user2:******@host2.com,http://user2@host2.com");
}
/**
* Utility method to create a SanitizableData instance for testing.
*/
private SanitizableData createSanitizableData(final String key, final String value) {
final var dummyPropertySource = new PropertySource<>("testSource") {
@Override
public Object getProperty(String name) {
return null; // No real property resolution needed for this test
}
};
return new SanitizableData(dummyPropertySource, key, value);
}
}

View File

@ -1,6 +1,7 @@
package net.hostsharing.hsadminng.config; package net.hostsharing.hsadminng.config;
import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.WireMockServer;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -17,8 +18,9 @@ import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static com.github.tomakehurst.wiremock.client.WireMock.*; import static com.github.tomakehurst.wiremock.client.WireMock.*;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@TestPropertySource(properties = "server.port=0") @TestPropertySource(properties = {"server.port=0", "hsadminng.cas.server=http://localhost:8088/cas"})
@ActiveProfiles("wiremock") // IMPORTANT: To test prod config, do not use test profile! @ActiveProfiles("wiremock") // IMPORTANT: To test prod config, do not use test profile!
@Tag("generalIntegrationTest")
class CasAuthenticationFilterIntegrationTest { class CasAuthenticationFilterIntegrationTest {
@Value("${local.server.port}") @Value("${local.server.port}")

View File

@ -2,6 +2,7 @@ package net.hostsharing.hsadminng.config;
import io.restassured.RestAssured; import io.restassured.RestAssured;
import net.hostsharing.hsadminng.HsadminNgApplication; import net.hostsharing.hsadminng.HsadminNgApplication;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.server.LocalManagementPort; import org.springframework.boot.test.web.server.LocalManagementPort;
@ -14,6 +15,7 @@ import static net.hostsharing.hsadminng.test.JsonMatcher.lenientlyEquals;
classes = { HsadminNgApplication.class, DisableSecurityConfig.class } classes = { HsadminNgApplication.class, DisableSecurityConfig.class }
) )
@ActiveProfiles("test") @ActiveProfiles("test")
@Tag("generalIntegrationTest")
class CustomActuatorEndpointAcceptanceTest { class CustomActuatorEndpointAcceptanceTest {
@LocalManagementPort @LocalManagementPort

View File

@ -3,6 +3,7 @@ package net.hostsharing.hsadminng.config;
import java.util.Map; import java.util.Map;
import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.WireMockServer;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -22,8 +23,9 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@TestPropertySource(properties = {"management.port=0", "server.port=0"}) @TestPropertySource(properties = {"management.port=0", "server.port=0", "hsadminng.cas.server=http://localhost:8088/cas"})
@ActiveProfiles("wiremock") // IMPORTANT: To test prod config, do not use test profile! @ActiveProfiles("wiremock") // IMPORTANT: To test prod config, do not use test profile!
@Tag("generalIntegrationTest")
class WebSecurityConfigIntegrationTest { class WebSecurityConfigIntegrationTest {
@Value("${local.server.port}") @Value("${local.server.port}")

View File

@ -19,6 +19,7 @@ import org.junit.jupiter.api.ClassOrderer;
import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestClassOrder; import org.junit.jupiter.api.TestClassOrder;
import org.junit.jupiter.api.TestMethodOrder; import org.junit.jupiter.api.TestMethodOrder;
@ -49,6 +50,7 @@ import static org.hamcrest.Matchers.matchesRegex;
@ActiveProfiles("test") @ActiveProfiles("test")
@Transactional @Transactional
@TestClassOrder(ClassOrderer.OrderAnnotation.class) // fail early on fetching problems @TestClassOrder(ClassOrderer.OrderAnnotation.class) // fail early on fetching problems
@Tag("bookingIntegrationTest")
class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup { class HsBookingItemControllerAcceptanceTest extends ContextBasedTestWithCleanup {
@LocalServerPort @LocalServerPort

View File

@ -10,6 +10,7 @@ import net.hostsharing.hsadminng.mapper.Array;
import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup; import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -38,6 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import({ Context.class, JpaAttempt.class }) @Import({ Context.class, JpaAttempt.class })
@Tag("bookingIntegrationTest")
class HsBookingItemRepositoryIntegrationTest extends ContextBasedTestWithCleanup { class HsBookingItemRepositoryIntegrationTest extends ContextBasedTestWithCleanup {
@Autowired @Autowired

View File

@ -8,6 +8,7 @@ import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import net.hostsharing.hsadminng.config.DisableSecurityConfig; import net.hostsharing.hsadminng.config.DisableSecurityConfig;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -29,6 +30,7 @@ import static org.hamcrest.Matchers.matchesRegex;
) )
hsh-michaelhoennig marked this conversation as resolved Outdated

!only-office oder rausnehmen

!only-office oder rausnehmen
@ActiveProfiles("test") @ActiveProfiles("test")
@Transactional @Transactional
@Tag("bookingIntegrationTest")
class HsBookingProjectControllerAcceptanceTest extends ContextBasedTestWithCleanup { class HsBookingProjectControllerAcceptanceTest extends ContextBasedTestWithCleanup {
@LocalServerPort @LocalServerPort

View File

@ -8,6 +8,7 @@ import net.hostsharing.hsadminng.mapper.Array;
import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup; import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.EnumSource;
@ -33,6 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import({ Context.class, JpaAttempt.class }) @Import({ Context.class, JpaAttempt.class })
@Tag("bookingIntegrationTest")
class HsBookingProjectRepositoryIntegrationTest extends ContextBasedTestWithCleanup { class HsBookingProjectRepositoryIntegrationTest extends ContextBasedTestWithCleanup {
@Autowired @Autowired

View File

@ -19,6 +19,7 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.ClassOrderer; import org.junit.jupiter.api.ClassOrderer;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestClassOrder; import org.junit.jupiter.api.TestClassOrder;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -49,6 +50,7 @@ import static org.hamcrest.Matchers.matchesRegex;
) )
@ActiveProfiles("test") @ActiveProfiles("test")
@TestClassOrder(ClassOrderer.OrderAnnotation.class) // fail early on fetching problems @TestClassOrder(ClassOrderer.OrderAnnotation.class) // fail early on fetching problems
@Tag("hostingIntegrationTest")
class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup { class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup {
@LocalServerPort @LocalServerPort

View File

@ -4,6 +4,7 @@ import io.restassured.RestAssured;
import net.hostsharing.hsadminng.HsadminNgApplication; import net.hostsharing.hsadminng.HsadminNgApplication;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import net.hostsharing.hsadminng.config.DisableSecurityConfig; import net.hostsharing.hsadminng.config.DisableSecurityConfig;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.boot.test.web.server.LocalServerPort;
@ -16,6 +17,7 @@ import static net.hostsharing.hsadminng.test.JsonMatcher.lenientlyEquals;
classes = { HsadminNgApplication.class, DisableSecurityConfig.class, JpaAttempt.class } classes = { HsadminNgApplication.class, DisableSecurityConfig.class, JpaAttempt.class }
) )
@ActiveProfiles("test") @ActiveProfiles("test")
@Tag("hostingIntegrationTest")
class HsHostingAssetPropsControllerAcceptanceTest { class HsHostingAssetPropsControllerAcceptanceTest {
@LocalServerPort @LocalServerPort

View File

@ -12,6 +12,7 @@ import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.hibernate.exception.ConstraintViolationException; import org.hibernate.exception.ConstraintViolationException;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.EnumSource;
@ -44,6 +45,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import({ Context.class, JpaAttempt.class }) @Import({ Context.class, JpaAttempt.class })
@Tag("hostingIntegrationTest")
class HsHostingAssetRepositoryIntegrationTest extends ContextBasedTestWithCleanup { class HsHostingAssetRepositoryIntegrationTest extends ContextBasedTestWithCleanup {
@Autowired @Autowired

View File

@ -32,6 +32,7 @@ import org.springframework.context.annotation.Import;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.test.annotation.Commit; import org.springframework.test.annotation.Commit;
import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ActiveProfiles;
import java.io.Reader; import java.io.Reader;
import java.net.IDN; import java.net.IDN;
@ -121,6 +122,7 @@ import static org.assertj.core.api.Assumptions.assumeThat;
}) })
@DirtiesContext @DirtiesContext
@Import({ Context.class, JpaAttempt.class }) @Import({ Context.class, JpaAttempt.class })
@ActiveProfiles("without-test-data")
@TestMethodOrder(MethodOrderer.OrderAnnotation.class) @TestMethodOrder(MethodOrderer.OrderAnnotation.class)
@ExtendWith(OrderedDependedTestsExtension.class) @ExtendWith(OrderedDependedTestsExtension.class)
public class ImportHostingAssets extends BaseOfficeDataImport { public class ImportHostingAssets extends BaseOfficeDataImport {

View File

@ -7,6 +7,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ActiveProfiles;
/* /*
* This 'test' includes the complete legacy 'office' data import. * This 'test' includes the complete legacy 'office' data import.
@ -51,6 +52,7 @@ import org.springframework.test.annotation.DirtiesContext;
"spring.datasource.password=${HSADMINNG_POSTGRES_ADMIN_PASSWORD:password}", "spring.datasource.password=${HSADMINNG_POSTGRES_ADMIN_PASSWORD:password}",
"hsadminng.superuser=${HSADMINNG_SUPERUSER:superuser-alex@hostsharing.net}" "hsadminng.superuser=${HSADMINNG_SUPERUSER:superuser-alex@hostsharing.net}"
}) })
@ActiveProfiles("without-test-data")
@DirtiesContext @DirtiesContext
@Import({ Context.class, JpaAttempt.class }) @Import({ Context.class, JpaAttempt.class })
@TestMethodOrder(MethodOrderer.OrderAnnotation.class) @TestMethodOrder(MethodOrderer.OrderAnnotation.class)

View File

@ -32,6 +32,7 @@ import static org.hamcrest.Matchers.startsWith;
) )
@ActiveProfiles("test") @ActiveProfiles("test")
@Transactional @Transactional
@Tag("officeIntegrationTest")
class HsOfficeBankAccountControllerAcceptanceTest extends ContextBasedTestWithCleanup { class HsOfficeBankAccountControllerAcceptanceTest extends ContextBasedTestWithCleanup {
@LocalServerPort @LocalServerPort

View File

@ -8,6 +8,7 @@ import net.hostsharing.hsadminng.mapper.Array;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -29,6 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import({ Context.class, JpaAttempt.class }) @Import({ Context.class, JpaAttempt.class })
@Tag("officeIntegrationTest")
class HsOfficeBankAccountRepositoryIntegrationTest extends ContextBasedTestWithCleanup { class HsOfficeBankAccountRepositoryIntegrationTest extends ContextBasedTestWithCleanup {
@Autowired @Autowired

View File

@ -12,6 +12,7 @@ import org.json.JSONException;
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -39,6 +40,7 @@ import static org.hamcrest.Matchers.startsWith;
) )
@ActiveProfiles("test") @ActiveProfiles("test")
@Transactional @Transactional
@Tag("officeIntegrationTest")
class HsOfficeContactControllerAcceptanceTest extends ContextBasedTestWithCleanup { class HsOfficeContactControllerAcceptanceTest extends ContextBasedTestWithCleanup {
@LocalServerPort @LocalServerPort

View File

@ -8,6 +8,7 @@ import net.hostsharing.hsadminng.mapper.Array;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -29,6 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import( { Context.class, JpaAttempt.class }) @Import( { Context.class, JpaAttempt.class })
@Tag("officeIntegrationTest")
class HsOfficeContactRbacRepositoryIntegrationTest extends ContextBasedTestWithCleanup { class HsOfficeContactRbacRepositoryIntegrationTest extends ContextBasedTestWithCleanup {
@Autowired @Autowired

View File

@ -11,6 +11,7 @@ import net.hostsharing.hsadminng.config.DisableSecurityConfig;
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -37,6 +38,7 @@ import static org.hamcrest.Matchers.startsWith;
) )
@ActiveProfiles("test") @ActiveProfiles("test")
@Transactional @Transactional
@Tag("officeIntegrationTest")
class HsOfficeCoopAssetsTransactionControllerAcceptanceTest extends ContextBasedTestWithCleanup { class HsOfficeCoopAssetsTransactionControllerAcceptanceTest extends ContextBasedTestWithCleanup {
@LocalServerPort @LocalServerPort

View File

@ -10,6 +10,7 @@ import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -31,6 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import( { Context.class, JpaAttempt.class }) @Import( { Context.class, JpaAttempt.class })
@Tag("officeIntegrationTest")
class HsOfficeCoopAssetsTransactionRepositoryIntegrationTest extends ContextBasedTestWithCleanup { class HsOfficeCoopAssetsTransactionRepositoryIntegrationTest extends ContextBasedTestWithCleanup {
@Autowired @Autowired

View File

@ -11,6 +11,7 @@ import net.hostsharing.hsadminng.config.DisableSecurityConfig;
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -34,6 +35,7 @@ import static org.hamcrest.Matchers.startsWith;
classes = {HsadminNgApplication.class, DisableSecurityConfig.class, JpaAttempt.class}) classes = {HsadminNgApplication.class, DisableSecurityConfig.class, JpaAttempt.class})
@ActiveProfiles("test") @ActiveProfiles("test")
@Transactional @Transactional
@Tag("officeIntegrationTest")
class HsOfficeCoopSharesTransactionControllerAcceptanceTest extends ContextBasedTestWithCleanup { class HsOfficeCoopSharesTransactionControllerAcceptanceTest extends ContextBasedTestWithCleanup {
@Autowired @Autowired

View File

@ -10,6 +10,7 @@ import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -30,6 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import( { Context.class, JpaAttempt.class }) @Import( { Context.class, JpaAttempt.class })
@Tag("officeIntegrationTest")
class HsOfficeCoopSharesTransactionRepositoryIntegrationTest extends ContextBasedTestWithCleanup { class HsOfficeCoopSharesTransactionRepositoryIntegrationTest extends ContextBasedTestWithCleanup {
@Autowired @Autowired

View File

@ -16,6 +16,7 @@ import net.hostsharing.hsadminng.config.DisableSecurityConfig;
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -43,6 +44,7 @@ import static org.hamcrest.Matchers.startsWith;
) )
@ActiveProfiles("test") @ActiveProfiles("test")
@Transactional @Transactional
@Tag("officeIntegrationTest")
class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanup { class HsOfficeDebitorControllerAcceptanceTest extends ContextBasedTestWithCleanup {
private static final int LOWEST_TEMP_DEBITOR_SUFFIX = 90; private static final int LOWEST_TEMP_DEBITOR_SUFFIX = 90;

View File

@ -17,6 +17,7 @@ import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.hibernate.Hibernate; import org.hibernate.Hibernate;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource; import org.junit.jupiter.params.provider.ValueSource;
@ -42,6 +43,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import( { Context.class, JpaAttempt.class, RbacGrantsDiagramService.class }) @Import( { Context.class, JpaAttempt.class, RbacGrantsDiagramService.class })
@Tag("officeIntegrationTest")
class HsOfficeDebitorRepositoryIntegrationTest extends ContextBasedTestWithCleanup { class HsOfficeDebitorRepositoryIntegrationTest extends ContextBasedTestWithCleanup {
@Autowired @Autowired

View File

@ -12,6 +12,7 @@ import net.hostsharing.hsadminng.config.DisableSecurityConfig;
import org.json.JSONException; import org.json.JSONException;
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -37,6 +38,7 @@ import static org.hamcrest.Matchers.*;
) )
@ActiveProfiles("test") @ActiveProfiles("test")
@Transactional @Transactional
@Tag("officeIntegrationTest")
class HsOfficeMembershipControllerAcceptanceTest extends ContextBasedTestWithCleanup { class HsOfficeMembershipControllerAcceptanceTest extends ContextBasedTestWithCleanup {
private static final String TEMP_MEMBER_NUMBER_SUFFIX = "90"; private static final String TEMP_MEMBER_NUMBER_SUFFIX = "90";

View File

@ -10,6 +10,7 @@ import net.hostsharing.hsadminng.rbac.role.RawRbacRoleRepository;
import net.hostsharing.hsadminng.mapper.Array; import net.hostsharing.hsadminng.mapper.Array;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -31,6 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import( { Context.class, JpaAttempt.class }) @Import( { Context.class, JpaAttempt.class })
@Tag("officeIntegrationTest")
class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTestWithCleanup { class HsOfficeMembershipRepositoryIntegrationTest extends ContextBasedTestWithCleanup {
@Autowired @Autowired

View File

@ -34,6 +34,7 @@ import static org.hamcrest.Matchers.*;
classes = { HsadminNgApplication.class, DisableSecurityConfig.class, JpaAttempt.class } classes = { HsadminNgApplication.class, DisableSecurityConfig.class, JpaAttempt.class }
) )
@ActiveProfiles("test") @ActiveProfiles("test")
@Tag("officeIntegrationTest")
class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanup { class HsOfficePartnerControllerAcceptanceTest extends ContextBasedTestWithCleanup {
private static final UUID GIVEN_NON_EXISTING_UUID = UUID.fromString("00000000-0000-0000-0000-000000000000"); private static final UUID GIVEN_NON_EXISTING_UUID = UUID.fromString("00000000-0000-0000-0000-000000000000");

View File

@ -13,6 +13,7 @@ import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -38,6 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import({ Context.class, JpaAttempt.class }) @Import({ Context.class, JpaAttempt.class })
@Tag("officeIntegrationTest")
class HsOfficePartnerRbacRepositoryIntegrationTest extends ContextBasedTestWithCleanup { class HsOfficePartnerRbacRepositoryIntegrationTest extends ContextBasedTestWithCleanup {
@Autowired @Autowired

View File

@ -10,6 +10,7 @@ import net.hostsharing.hsadminng.config.DisableSecurityConfig;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -31,6 +32,7 @@ import static org.hamcrest.Matchers.*;
classes = { HsadminNgApplication.class, DisableSecurityConfig.class, JpaAttempt.class } classes = { HsadminNgApplication.class, DisableSecurityConfig.class, JpaAttempt.class }
) )
@ActiveProfiles("test") @ActiveProfiles("test")
@Tag("officeIntegrationTest")
class HsOfficePersonControllerAcceptanceTest extends ContextBasedTestWithCleanup { class HsOfficePersonControllerAcceptanceTest extends ContextBasedTestWithCleanup {
@LocalServerPort @LocalServerPort

View File

@ -8,6 +8,7 @@ import net.hostsharing.hsadminng.mapper.Array;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -29,6 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import( { Context.class, JpaAttempt.class }) @Import( { Context.class, JpaAttempt.class })
@Tag("officeIntegrationTest")
class HsOfficePersonRbacRepositoryIntegrationTest extends ContextBasedTestWithCleanup { class HsOfficePersonRbacRepositoryIntegrationTest extends ContextBasedTestWithCleanup {
@Autowired @Autowired

View File

@ -7,6 +7,7 @@ import net.hostsharing.hsadminng.rbac.role.RawRbacRoleRepository;
import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup; import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -27,6 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import( { Context.class, JpaAttempt.class }) @Import( { Context.class, JpaAttempt.class })
@Tag("officeIntegrationTest")
class HsOfficePersonRealRepositoryIntegrationTest extends ContextBasedTestWithCleanup { class HsOfficePersonRealRepositoryIntegrationTest extends ContextBasedTestWithCleanup {
@Autowired @Autowired

View File

@ -6,6 +6,7 @@ import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonType;
import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup; import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -24,6 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import( { Context.class, JpaAttempt.class }) @Import( { Context.class, JpaAttempt.class })
@Tag("officeIntegrationTest")
class HsOfficeRealRelationRepositoryIntegrationTest extends ContextBasedTestWithCleanup { class HsOfficeRealRelationRepositoryIntegrationTest extends ContextBasedTestWithCleanup {
@Autowired @Autowired

View File

@ -11,6 +11,7 @@ import net.hostsharing.hsadminng.hs.office.generated.api.v1.model.HsOfficeRelati
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import net.hostsharing.hsadminng.config.DisableSecurityConfig; import net.hostsharing.hsadminng.config.DisableSecurityConfig;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -33,6 +34,7 @@ import static org.hamcrest.Matchers.hasEntry;
) )
@ActiveProfiles("test") @ActiveProfiles("test")
@Transactional @Transactional
@Tag("officeIntegrationTest")
class HsOfficeRelationControllerAcceptanceTest extends ContextBasedTestWithCleanup { class HsOfficeRelationControllerAcceptanceTest extends ContextBasedTestWithCleanup {
public static final UUID GIVEN_NON_EXISTING_HOLDER_PERSON_UUID = UUID.fromString("00000000-0000-0000-0000-000000000000"); public static final UUID GIVEN_NON_EXISTING_HOLDER_PERSON_UUID = UUID.fromString("00000000-0000-0000-0000-000000000000");

View File

@ -10,6 +10,7 @@ import net.hostsharing.hsadminng.rbac.role.RawRbacRoleRepository;
import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup; import net.hostsharing.hsadminng.rbac.test.ContextBasedTestWithCleanup;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -32,6 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import({ Context.class, JpaAttempt.class }) @Import({ Context.class, JpaAttempt.class })
@Tag("officeIntegrationTest")
class HsOfficeRelationRepositoryIntegrationTest extends ContextBasedTestWithCleanup { class HsOfficeRelationRepositoryIntegrationTest extends ContextBasedTestWithCleanup {
@Autowired @Autowired

View File

@ -12,6 +12,7 @@ import net.hostsharing.hsadminng.config.DisableSecurityConfig;
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -36,6 +37,7 @@ import static org.hamcrest.Matchers.*;
) )
@ActiveProfiles("test") @ActiveProfiles("test")
@Transactional @Transactional
@Tag("officeIntegrationTest")
class HsOfficeSepaMandateControllerAcceptanceTest extends ContextBasedTestWithCleanup { class HsOfficeSepaMandateControllerAcceptanceTest extends ContextBasedTestWithCleanup {
@LocalServerPort @LocalServerPort

View File

@ -10,6 +10,7 @@ import net.hostsharing.hsadminng.rbac.role.RawRbacRoleRepository;
import net.hostsharing.hsadminng.mapper.Array; import net.hostsharing.hsadminng.mapper.Array;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -32,6 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import({ Context.class, JpaAttempt.class }) @Import({ Context.class, JpaAttempt.class })
@Tag("officeIntegrationTest")
class HsOfficeSepaMandateRepositoryIntegrationTest extends ContextBasedTestWithCleanup { class HsOfficeSepaMandateRepositoryIntegrationTest extends ContextBasedTestWithCleanup {
@Autowired @Autowired

View File

@ -1,5 +1,6 @@
package net.hostsharing.hsadminng.mapper; package net.hostsharing.hsadminng.mapper;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -11,6 +12,7 @@ import java.util.UUID;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Tag("generalIntegrationTest")
class PostgresArrayIntegrationTest { class PostgresArrayIntegrationTest {
@Autowired @Autowired

View File

@ -5,6 +5,7 @@ import net.hostsharing.hsadminng.mapper.Array;
import net.hostsharing.hsadminng.mapper.StrictMapper; import net.hostsharing.hsadminng.mapper.StrictMapper;
import net.hostsharing.hsadminng.persistence.EntityManagerWrapper; import net.hostsharing.hsadminng.persistence.EntityManagerWrapper;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -19,6 +20,7 @@ import jakarta.servlet.http.HttpServletRequest;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
@Tag("generalIntegrationTest")
@DataJpaTest @DataJpaTest
@ComponentScan(basePackageClasses = { Context.class, JpaAttempt.class, EntityManagerWrapper.class, StrictMapper.class }) @ComponentScan(basePackageClasses = { Context.class, JpaAttempt.class, EntityManagerWrapper.class, StrictMapper.class })
@DirtiesContext @DirtiesContext

View File

@ -13,6 +13,7 @@ import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import net.hostsharing.hsadminng.config.DisableSecurityConfig; import net.hostsharing.hsadminng.config.DisableSecurityConfig;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -37,6 +38,7 @@ import static org.hamcrest.Matchers.*;
) )
@ActiveProfiles("test") @ActiveProfiles("test")
@Transactional(readOnly = true, propagation = Propagation.NEVER) @Transactional(readOnly = true, propagation = Propagation.NEVER)
@Tag("generalIntegrationTest")
class RbacGrantControllerAcceptanceTest extends ContextBasedTest { class RbacGrantControllerAcceptanceTest extends ContextBasedTest {
@LocalServerPort @LocalServerPort

View File

@ -7,6 +7,7 @@ import net.hostsharing.hsadminng.rbac.subject.RbacSubjectEntity;
import net.hostsharing.hsadminng.rbac.subject.RbacSubjectRepository; import net.hostsharing.hsadminng.rbac.subject.RbacSubjectRepository;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -27,6 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import( { Context.class, JpaAttempt.class }) @Import( { Context.class, JpaAttempt.class })
@Tag("generalIntegrationTest")
class RbacGrantRepositoryIntegrationTest extends ContextBasedTest { class RbacGrantRepositoryIntegrationTest extends ContextBasedTest {
@Autowired @Autowired

View File

@ -6,6 +6,7 @@ import net.hostsharing.hsadminng.rbac.grant.RbacGrantsDiagramService.Include;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo; import org.junit.jupiter.api.TestInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -23,6 +24,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import( { Context.class, JpaAttempt.class, RbacGrantsDiagramService.class}) @Import( { Context.class, JpaAttempt.class, RbacGrantsDiagramService.class})
@Tag("generalIntegrationTest")
class RbacGrantsDiagramServiceIntegrationTest extends ContextBasedTestWithCleanup { class RbacGrantsDiagramServiceIntegrationTest extends ContextBasedTestWithCleanup {
@Autowired @Autowired

View File

@ -5,6 +5,7 @@ import net.hostsharing.hsadminng.HsadminNgApplication;
import net.hostsharing.hsadminng.context.Context; import net.hostsharing.hsadminng.context.Context;
import net.hostsharing.hsadminng.rbac.subject.RbacSubjectRepository; import net.hostsharing.hsadminng.rbac.subject.RbacSubjectRepository;
import net.hostsharing.hsadminng.config.DisableSecurityConfig; import net.hostsharing.hsadminng.config.DisableSecurityConfig;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -18,6 +19,7 @@ import static org.hamcrest.Matchers.*;
classes = {HsadminNgApplication.class, DisableSecurityConfig.class} classes = {HsadminNgApplication.class, DisableSecurityConfig.class}
) )
@ActiveProfiles("test") @ActiveProfiles("test")
@Tag("generalIntegrationTest")
class RbacRoleControllerAcceptanceTest { class RbacRoleControllerAcceptanceTest {
@LocalServerPort @LocalServerPort

View File

@ -4,6 +4,7 @@ import net.hostsharing.hsadminng.context.Context;
import net.hostsharing.hsadminng.mapper.Array; import net.hostsharing.hsadminng.mapper.Array;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -20,6 +21,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import( { Context.class, JpaAttempt.class }) @Import( { Context.class, JpaAttempt.class })
@Tag("generalIntegrationTest")
class RbacRoleRepositoryIntegrationTest { class RbacRoleRepositoryIntegrationTest {
@Autowired @Autowired

View File

@ -7,6 +7,7 @@ import net.hostsharing.hsadminng.context.Context;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import net.hostsharing.hsadminng.config.DisableSecurityConfig; import net.hostsharing.hsadminng.config.DisableSecurityConfig;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -25,6 +26,7 @@ import static org.hamcrest.Matchers.*;
) )
@ActiveProfiles("test") @ActiveProfiles("test")
@Transactional @Transactional
@Tag("generalIntegrationTest")
class RbacSubjectControllerAcceptanceTest { class RbacSubjectControllerAcceptanceTest {
@LocalServerPort @LocalServerPort

View File

@ -5,6 +5,7 @@ import net.hostsharing.hsadminng.rbac.context.ContextBasedTest;
import net.hostsharing.hsadminng.mapper.Array; import net.hostsharing.hsadminng.mapper.Array;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -26,6 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import( { Context.class, JpaAttempt.class }) @Import( { Context.class, JpaAttempt.class })
@Tag("generalIntegrationTest")
class RbacSubjectRepositoryIntegrationTest extends ContextBasedTest { class RbacSubjectRepositoryIntegrationTest extends ContextBasedTest {
@Autowired @Autowired

View File

@ -9,6 +9,7 @@ import net.hostsharing.hsadminng.config.DisableSecurityConfig;
import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -30,6 +31,7 @@ import static org.hamcrest.Matchers.*;
) )
@ActiveProfiles("test") @ActiveProfiles("test")
@Transactional @Transactional
@Tag("generalIntegrationTest")
class TestCustomerControllerAcceptanceTest { class TestCustomerControllerAcceptanceTest {
@LocalServerPort @LocalServerPort

View File

@ -4,6 +4,7 @@ import net.hostsharing.hsadminng.context.Context;
import net.hostsharing.hsadminng.rbac.context.ContextBasedTest; import net.hostsharing.hsadminng.rbac.context.ContextBasedTest;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -19,6 +20,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import( { Context.class, JpaAttempt.class }) @Import( { Context.class, JpaAttempt.class })
@Tag("generalIntegrationTest")
class TestCustomerRepositoryIntegrationTest extends ContextBasedTest { class TestCustomerRepositoryIntegrationTest extends ContextBasedTest {
@Autowired @Autowired

View File

@ -7,6 +7,7 @@ import net.hostsharing.hsadminng.context.Context;
import net.hostsharing.hsadminng.config.DisableSecurityConfig; import net.hostsharing.hsadminng.config.DisableSecurityConfig;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -28,6 +29,7 @@ import static org.hamcrest.Matchers.is;
) )
@ActiveProfiles("test") @ActiveProfiles("test")
@Transactional @Transactional
@Tag("generalIntegrationTest")
class TestPackageControllerAcceptanceTest { class TestPackageControllerAcceptanceTest {
@LocalServerPort @LocalServerPort

View File

@ -4,6 +4,7 @@ import net.hostsharing.hsadminng.context.Context;
import net.hostsharing.hsadminng.rbac.context.ContextBasedTest; import net.hostsharing.hsadminng.rbac.context.ContextBasedTest;
import net.hostsharing.hsadminng.rbac.test.JpaAttempt; import net.hostsharing.hsadminng.rbac.test.JpaAttempt;
import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
@ -20,6 +21,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@DataJpaTest @DataJpaTest
@Import( { Context.class, JpaAttempt.class }) @Import( { Context.class, JpaAttempt.class })
@Tag("generalIntegrationTest")
class TestPackageRepositoryIntegrationTest extends ContextBasedTest { class TestPackageRepositoryIntegrationTest extends ContextBasedTest {
@Autowired @Autowired