Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] develop from Onlineberatung:develop #141

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/admin-api-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup JVM
uses: actions/setup-java@v1
with:
java-version: 11.0.10
java-version: 17
java-package: jdk
architecture: x64

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dockerImage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: mvn -B -Pprod clean package -DskipTests
- name: Maven Verify
run: mvn -B -Pprod clean verify
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: targetfiles
path: target/*.jar
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Download buildfiles artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: targetfiles
- name: Get current time
Expand Down Expand Up @@ -183,4 +183,4 @@ jobs:
value: ${{ env.DOCKER_IMAGE_TAG }}
custom-actions: |
- text: View CI
url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
67 changes: 26 additions & 41 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.6</version>
<version>3.3.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

Expand All @@ -38,7 +38,7 @@
<spring-boot-autoconfigure.version>3.0.6</spring-boot-autoconfigure.version>
<liquibase-core.version>4.23.2</liquibase-core.version>
<springfox-boot-starter.version>3.0.0</springfox-boot-starter.version>
<spring-security.version>6.0.5</spring-security.version>
<spring-security.version>6.3.4</spring-security.version>
<springfox.version>2.9.2</springfox.version>
<springfox-swagger-ui.version>2.10.0</springfox-swagger-ui.version>
<spring-security-oauth2-test-webmvc-addons.version>3.0.1</spring-security-oauth2-test-webmvc-addons.version>
Expand Down Expand Up @@ -89,17 +89,14 @@
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${spring-security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring-security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${spring-security.version}</version>
</dependency>
<!-- Spring actuator -->
<dependency>
Expand All @@ -124,17 +121,6 @@
<artifactId>plexus-utils</artifactId>
<version>3.3.0</version>
</dependency>
<!-- SpringFox: generate YAML file from POJOs and generate documentation -->
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.2.15</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>${springfox.boot.starter.version}</version>
</dependency>
<dependency>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser</artifactId>
Expand Down Expand Up @@ -171,9 +157,8 @@
<version>${keycloak.version}</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>${javax.ws.rs-api.version}</version>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
</dependency>

<!-- Lombok dependencies -->
Expand All @@ -183,11 +168,11 @@
<optional>true</optional>
</dependency>


<!-- Apache Commons Lang -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>

<dependency>
Expand All @@ -212,7 +197,6 @@
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>${liquibase-core.version}</version>
</dependency>


Expand Down Expand Up @@ -242,17 +226,14 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>${log4j.version}</version>
</dependency>


Expand All @@ -266,12 +247,6 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.2.15</version>
</dependency>


Expand All @@ -282,7 +257,6 @@
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
<version>${h2.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -294,12 +268,6 @@
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- required only for WebMvc "fluent" API -->
<groupId>com.c4-soft.springaddons</groupId>
Expand All @@ -318,6 +286,7 @@
</resource>
</resources>
<plugins>

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
Expand Down Expand Up @@ -554,7 +523,6 @@
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>${liquibase-maven-plugin.version}</version>
<configuration>
<propertyFile>src/main/resources/liquibase.properties</propertyFile>
</configuration>
Expand All @@ -563,7 +531,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.3.0</version>
<version>3.6.0</version>
<executions>
<execution>
<id>validate</id>
Expand All @@ -587,9 +555,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>17</source>
<target>17</target>
<compilerArgs>--enable-preview</compilerArgs>
<release>${java.version}</release>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -629,6 +596,24 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>5.46.1</version>
<configuration>
<exportDatatables>true</exportDatatables>
<activeRecipes>
<recipe>org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_3</recipe>
</activeRecipes>
</configuration>
<dependencies>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-spring</artifactId>
<version>5.24.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import de.caritas.cob.agencyservice.api.model.Sort;
import de.caritas.cob.agencyservice.api.model.UpdateAgencyDTO;
import de.caritas.cob.agencyservice.generated.api.admin.controller.AgencyadminApi;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;

Expand All @@ -33,7 +33,7 @@
* Controller to handle all agency admin requests.
*/
@RestController
@Api(tags = "admin-agency-controller")
@Tag(name = "admin-agency-controller")
@RequiredArgsConstructor
public class AgencyAdminController implements AgencyadminApi {

Expand Down Expand Up @@ -92,8 +92,6 @@ public ResponseEntity<AgencyAdminSearchResultDTO> searchAgencies(
@Override
@PreAuthorize("hasAuthority('AUTHORIZATION_AGENCY_ADMIN')")
public ResponseEntity<AgencyAdminFullResponseDTO> createAgency(@Valid AgencyDTO agencyDTO) {


agencyValidator.validate(agencyDTO);
var agencyAdminFullResponseDTO = agencyAdminService
.createAgency(agencyDTO);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import de.caritas.cob.agencyservice.api.model.FullAgencyResponseDTO;
import de.caritas.cob.agencyservice.api.service.AgencyService;
import de.caritas.cob.agencyservice.generated.api.controller.AgenciesApi;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import java.util.Optional;
import lombok.NonNull;
Expand All @@ -22,7 +22,7 @@
* Controller for agency API requests
*/
@RestController
@Api(tags = "agency-controller")
@Tag(name = "agency-controller")
@RequiredArgsConstructor
public class AgencyController implements AgenciesApi {

Expand All @@ -40,10 +40,10 @@ public class AgencyController implements AgenciesApi {
@Override
public ResponseEntity<List<FullAgencyResponseDTO>> getAgencies(
@RequestParam Integer consultingType, @RequestParam(required = false) String postcode,
@RequestParam(value = "topicId", required = false) Integer topicId,
@RequestParam(value = "age", required = false) Integer age,
@RequestParam(value = "gender", required = false) String gender,
@RequestParam(value = "counsellingRelation", required = false) String counsellingRelation
@RequestParam(required = false) Integer topicId,
@RequestParam(required = false) Integer age,
@RequestParam(required = false) String gender,
@RequestParam(required = false) String counsellingRelation
) {

var agencies = agencyService.getAgencies(Optional.ofNullable(postcode), consultingType,
Expand All @@ -62,7 +62,7 @@ public ResponseEntity<List<FullAgencyResponseDTO>> getAgencies(
*/
@Override
public ResponseEntity<List<AgencyResponseDTO>> getAgenciesByIds(
@PathVariable("agencyIds") List<Long> agencyIds) {
@PathVariable List<Long> agencyIds) {

var agencies = agencyService.getAgencies(agencyIds);

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package de.caritas.cob.agencyservice.api.exception;

import java.io.Serial;

public class KeycloakException extends RuntimeException {

@Serial
private static final long serialVersionUID = -5083156826149548581L;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package de.caritas.cob.agencyservice.api.exception;

import java.io.Serial;

public class MissingConsultingTypeException extends Exception {

@Serial
private static final long serialVersionUID = -6127271234647444277L;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package de.caritas.cob.agencyservice.api.exception.httpresponses;

import de.caritas.cob.agencyservice.api.service.LogService;
import java.io.Serial;

public class BadRequestException extends CustomHttpStatusException {

@Serial
private static final long serialVersionUID = -8047408802295905803L;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

import static java.util.Objects.nonNull;

import java.io.Serial;
import java.util.function.Consumer;

/**
* Custom HTTP status exception.
*/
public abstract class CustomHttpStatusException extends RuntimeException {

@Serial
private static final long serialVersionUID = -3545035432045919306L;
private final Consumer<Exception> loggingMethod;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package de.caritas.cob.agencyservice.api.exception.httpresponses;

import de.caritas.cob.agencyservice.api.service.LogService;
import java.io.Serial;
import java.util.function.Consumer;

/**
* Represents the exception for an internal server error - status code 500.
*/
public class InternalServerErrorException extends CustomHttpStatusException {

@Serial
private static final long serialVersionUID = 6051508644381775936L;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public ExtendedConsultingTypeResponseDTO getConsultingTypeSettings(int consultin
return consultingTypeService.getExtendedConsultingTypeResponseDTO(consultingTypeId);
} catch (RestClientException ex) {
throw new MissingConsultingTypeException(
String.format("No settings for consulting type %s found.", consultingTypeId));
"No settings for consulting type %s found.".formatted(consultingTypeId));
}
}

Expand Down
Loading