Skip to content

Commit

Permalink
Merge pull request #5 from Onlineberatung/develop
Browse files Browse the repository at this point in the history
upgrade to spring boot 2.7
  • Loading branch information
tkuzynow authored Jul 26, 2024
2 parents 332c991 + 17dbe37 commit 5b76277
Show file tree
Hide file tree
Showing 30 changed files with 259 additions and 468 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dockerImage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
push_to_registry:
strategy:
matrix:
registry: ["docker.pkg.github.com", "ghcr.io"]
registry: ["ghcr.io"]
needs: [test]
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
Expand Down
53 changes: 31 additions & 22 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>2.5.12</version>
<version>2.7.18</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

Expand All @@ -30,7 +30,7 @@
<openapi-generator-maven.version>6.2.1</openapi-generator-maven.version>
<springfox-boot-starter.version>3.0.0</springfox-boot-starter.version>
<spring-data-mongodb.version>3.3.5</spring-data-mongodb.version>
<spring-security.version>5.7.5</spring-security.version>
<spring-security.version>5.7.12</spring-security.version>
<ehcache.version>2.10.9.2</ehcache.version>
</properties>

Expand Down Expand Up @@ -64,6 +64,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
<version>2.7.5</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
Expand All @@ -73,7 +74,6 @@
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.1.6.Final</version>
</dependency>

<!-- OpenApi/Swagger dependencies -->
Expand Down Expand Up @@ -104,13 +104,6 @@
<version>4.3.1</version>
</dependency>

<!-- SpringFox: generate YAML file from POJOs and generate documentation -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>${springfox-boot-starter.version}</version>
</dependency>

<!-- Keycloak dependencies -->
<dependency>
<groupId>org.keycloak</groupId>
Expand Down Expand Up @@ -150,7 +143,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.11</version>
</dependency>

<dependency>
Expand All @@ -168,7 +160,6 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>2.3.5.RELEASE</version>
</dependency>

<dependency>
Expand All @@ -195,23 +186,23 @@
<exclusions>
</exclusions>
</dependency>

<dependency>
<artifactId>powermock-module-junit4</artifactId>
<groupId>org.powermock</groupId>
<groupId>de.flapdoodle.embed</groupId>
<artifactId>de.flapdoodle.embed.mongo</artifactId>
<version>4.13.0</version>
<scope>test</scope>
<version>2.0.2</version>
</dependency>
<dependency>
<artifactId>powermock-api-mockito2</artifactId>
<groupId>org.powermock</groupId>
<scope>test</scope>
<version>2.0.2</version>
<groupId>de.flapdoodle.embed</groupId>
<artifactId>de.flapdoodle.embed.mongo.spring26x</artifactId>
<version>4.13.0</version>
</dependency>

<dependency>
<groupId>de.flapdoodle.embed</groupId>
<artifactId>de.flapdoodle.embed.mongo</artifactId>
<scope>test</scope>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.16.1</version>
</dependency>

<!-- EasyRandom -->
Expand All @@ -237,6 +228,24 @@
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>5.30.0</version>
<configuration>
<activeRecipes>
<recipe>org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7</recipe>
</activeRecipes>
</configuration>
<dependencies>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-spring</artifactId>
<version>5.9.0</version>
</dependency>
</dependencies>
</plugin>

<!-- OpenApi codegen maven plugin: generates api stubs -->
<plugin>
<groupId>org.openapitools</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class StatisticsServiceApplication {

static {
System.setProperty("os.arch", "i686_64");
}

public static void main(String[] args) {
SpringApplication.run(StatisticsServiceApplication.class, args);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package de.caritas.cob.statisticsservice.config;

import org.keycloak.adapters.KeycloakConfigResolver;
import org.keycloak.adapters.springboot.KeycloakSpringBootConfigResolver;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
Expand All @@ -25,4 +27,14 @@ public LocalValidatorFactoryBean validator(MessageSource messageSource) {
return validatorFactoryBean;
}

/**
* Use the KeycloakSpringBootConfigResolver to be able to save the Keycloak settings in the spring
* application properties.
*/
@Bean
public KeycloakConfigResolver keyCloakConfigResolver() {
return new KeycloakSpringBootConfigResolver();
}


}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,6 @@ protected void configure(HttpSecurity http) throws Exception {
.anyRequest().denyAll();
}

/**
* Use the KeycloakSpringBootConfigResolver to be able to save the Keycloak settings in the spring
* application properties.
*/
@Bean
public KeycloakConfigResolver keyCloakConfigResolver() {
return new KeycloakSpringBootConfigResolver();
}

/**
* Change springs authentication strategy to be stateless (no session is being created).
Expand Down

This file was deleted.

4 changes: 4 additions & 0 deletions src/main/resources/application-testing.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ csrf.header.property=X-CSRF-TOKEN
csrf.cookie.property=CSRF-TOKEN
consulting.type.service.api.url=

spring.mongodb.embedded.version=5.0.6
spring.data.mongodb.uri=mongodb://mongodb:27017/consulting_types?retryWrites=false
de.flapdoodle.mongodb.embedded.version=5.0.6


4 changes: 2 additions & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spring.data.jpa.repositories.bootstrap-mode=default
# General app settings
server.port=8080

spring.mvc.locale=de_DE
spring.web.locale=de_DE
spring.jackson.time-zone=Europe/Berlin

# Logging: SLF4J (via Lombok)
Expand Down Expand Up @@ -75,6 +75,6 @@ tenant.service.api.url=http://tenantservice:8080
management.endpoint.health.enabled=true
management.endpoint.health.show-details=never
management.endpoints.web.exposure.include=health
management.health.probes.enabled=true
management.endpoint.health.probes.enabled=true
management.metrics.mongo.command.enabled=false
management.metrics.mongo.connectionpool.enabled=false
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import static org.hamcrest.Matchers.nullValue;

import de.caritas.cob.statisticsservice.api.authorization.Authority.AuthorityValue;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class AuthorityTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.junit.Test;

import org.junit.jupiter.api.Test;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;

Expand Down
Loading

0 comments on commit 5b76277

Please sign in to comment.