Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/maven/org.springframework.data-…
Browse files Browse the repository at this point in the history
…spring-data-commons-3.3.2
  • Loading branch information
dtrouillet authored Aug 1, 2024
2 parents b5c477d + 4caf438 commit d2c1fd8
Show file tree
Hide file tree
Showing 31 changed files with 100 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 17
java-version: 21
- name: Set env
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
- name: Dockerize with Maven
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 17, 19 ]
java: [ 17, 21, 22 ]
steps:
- uses: actions/checkout@v1
- name: Cache Maven Repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 17
java-version: 21
- name: Build with Maven
run: mvn -B --no-transfer-progress org.jacoco:jacoco-maven-plugin:prepare-agent package --file pom.xml --settings settings.xml
env:
Expand Down
51 changes: 21 additions & 30 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<version>3.0.0</version>
<version>3.3.2</version>
<relativePath />
</parent>
<licenses>
Expand Down Expand Up @@ -41,9 +41,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<assertj-core.version>1.0.0m1</assertj-core.version>
<awaitility.version>1.7.0</awaitility.version>
<commons-io.version>2.16.1</commons-io.version>
<commons-lang.version>3.13.0</commons-lang.version>
<commons-lang.version>3.15.0</commons-lang.version>
<gatling-maven-plugin.version>2.2.4</gatling-maven-plugin.version>
<gatling.version>2.3.0</gatling.version>
<java.version>17</java.version>
Expand All @@ -61,7 +60,7 @@
<usertype-core.version>7.0.0.CR1</usertype-core.version>
<project.testresult.directory>${project.build.directory}/test-results</project.testresult.directory>
<pf4j-spring.version>0.9.0</pf4j-spring.version>
<jobrunr.version>5.3.1</jobrunr.version>
<jobrunr.version>7.2.2</jobrunr.version>
<pf4j.version>3.12.0</pf4j.version>
<git.user />
<git.password />
Expand Down Expand Up @@ -96,7 +95,7 @@
</dependency>
<dependency>
<groupId>org.jobrunr</groupId>
<artifactId>jobrunr-spring-boot-starter</artifactId>
<artifactId>jobrunr-spring-boot-3-starter</artifactId>
<version>${jobrunr.version}</version>
<exclusions>
<exclusion>
Expand Down Expand Up @@ -126,7 +125,7 @@
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-hibernate5</artifactId>
<artifactId>jackson-datatype-hibernate6</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
Expand All @@ -147,18 +146,10 @@
<scope>runtime</scope>
<version>2.3.230</version>
</dependency>

<dependency>
<groupId>com.jayway.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${awaitility.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.sshd</groupId>
<artifactId>sshd-core</artifactId>
<version>2.8.0</version>
<version>2.13.2</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down Expand Up @@ -222,17 +213,17 @@
<dependency>
<groupId> org.hibernate.orm</groupId>
<artifactId>hibernate-jcache</artifactId>
<version>6.1.5.Final</version>
<version>6.5.2.Final</version>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache-transactions</artifactId>
<version>3.10.6</version>
<version>3.10.8</version>
</dependency>
<dependency>
<groupId> org.hibernate.orm</groupId>
<artifactId>hibernate-envers</artifactId>
<version>6.1.5.Final</version>
<version>6.5.2.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
Expand All @@ -242,7 +233,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.6.12.Final</version>
<version>5.6.15.Final</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -319,7 +310,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
<version>3.0.6</version>
<version>3.3.2</version>
</dependency>


Expand Down Expand Up @@ -355,14 +346,14 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
<version>1.18.34</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.zalando</groupId>
<artifactId>problem-spring-web</artifactId>
<version>0.27.0</version>
<version>0.29.1</version>
</dependency>

<dependency>
Expand All @@ -385,7 +376,7 @@
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-core</artifactId>
<version>5.0.0</version>
<version>5.1.0</version>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
Expand Down Expand Up @@ -413,7 +404,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-data-rest</artifactId>
<version>1.7.0</version>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -428,7 +419,7 @@
<dependency>
<groupId>org.apache.sshd</groupId>
<artifactId>sshd-sftp</artifactId>
<version>2.8.0</version>
<version>2.13.2</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
Expand Down Expand Up @@ -478,7 +469,7 @@
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>4.17.2</version>
<version>4.29.1</version>
</dependency>

<!-- WEBSOCKET -->
Expand Down Expand Up @@ -542,7 +533,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
<executions>
<execution>
<phase>initialize</phase>
Expand Down Expand Up @@ -589,7 +580,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
Expand All @@ -602,7 +593,7 @@
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
<version>1.18.34</version>
</path>
<path>
<groupId>org.projectlombok</groupId>
Expand All @@ -615,7 +606,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
<version>3.3.1</version>
<configuration>
<forkCount>2</forkCount>
<reuseForks>true</reuseForks>
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/fr/icdc/ebad/EbadApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.core.env.Environment;
import org.springframework.data.web.config.EnableSpringDataWebSupport;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;

import static org.springframework.data.web.config.EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO;

@SpringBootApplication
@ComponentScan(excludeFilters={@ComponentScan.Filter(type= FilterType.ASSIGNABLE_TYPE, value=SpringDocDataRestConfiguration.class)})
@EnableConfigurationProperties(EbadProperties.class)
@EnableAsync
@EnableScheduling
@EnableSpringDataWebSupport(pageSerializationMode = VIA_DTO)
public class EbadApplication {
private static final Logger APPLICATION_LOGGER = LoggerFactory.getLogger(EbadApplication.class);

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/fr/icdc/ebad/config/DatabaseConfiguration.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package fr.icdc.ebad.config;

import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module;
import com.fasterxml.jackson.datatype.hibernate6.Hibernate6Module;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
Expand All @@ -14,7 +14,7 @@
@EnableTransactionManagement
public class DatabaseConfiguration {
@Bean
public Hibernate5Module hibernate5Module() {
return new Hibernate5Module();
public Hibernate6Module hibernate5Module() {
return new Hibernate6Module();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fr.icdc.ebad.config.apidoc;

import com.querydsl.core.types.Predicate;
import org.springdoc.core.SpringDocConfigProperties;
import org.springdoc.core.customizers.DataRestDelegatingMethodParameterCustomizer;
import org.springdoc.core.customizers.DelegatingMethodParameterCustomizer;
import org.springdoc.core.providers.RepositoryRestConfigurationProvider;
Expand Down Expand Up @@ -62,7 +63,7 @@ class QuerydslProvider {
QuerydslPredicateOperationCustomizer queryDslQuerydslPredicateOperationCustomizer(Optional<QuerydslBindingsFactory> querydslBindingsFactory) {
if (querydslBindingsFactory.isPresent()) {
getConfig().addRequestWrapperToIgnore(Predicate.class);
return new QuerydslPredicateOperationCustomizer(querydslBindingsFactory.get());
return new QuerydslPredicateOperationCustomizer(querydslBindingsFactory.get(), new SpringDocConfigProperties());
}
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/fr/icdc/ebad/domain/GlobalSetting.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class GlobalSetting {
@Id
@Column(name = "key")
@Column(name = "`key`")
private String key;

@Column(name = "value", nullable = false)
@Column(name = "`value`", nullable = false)
private String value;

@Column(name = "label", nullable = false)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/fr/icdc/ebad/repository/UserRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ default void customize(QuerydslBindings bindings, QUser root) {
@Query("select user from User user left join user.usageApplications usageApplication left join usageApplication.application application left join application.environnements environnement left join environnement.batchs batch where batch.id = :batch and user.login = :login and usageApplication.canManage = true")
User findManagerFromBatch(@Param("batch") Long batch, @Param("login") String login);

@Query("select user from User user left join user.usageApplications usageApplication on user.id = usageApplication.user left join usageApplication.application application where application.id = :application and user.login = :login and usageApplication.canUse = true")
@Query("select user from User user left join user.usageApplications usageApplication on user.id = usageApplication.user.id left join usageApplication.application application where application.id = :application and user.login = :login and usageApplication.canUse = true")
User findUserFromApplication(@Param("application") Long application, @Param("login") String login);

@Query("select user from User user left join user.usageApplications usageApplication on user.id = usageApplication.user left join usageApplication.application application where application.id = :application and user.login = :login and usageApplication.canManage = true")
@Query("select user from User user left join user.usageApplications usageApplication on user.id = usageApplication.user.id left join usageApplication.application application where application.id = :application and user.login = :login and usageApplication.canManage = true")
User findManagerFromApplication(@Param("application") Long application, @Param("login") String login);

@Query("select user from User user left join user.usageApplications usageApplication left join usageApplication.application application left join application.environnements environnement where environnement.id = :env and user.login = :login and usageApplication.canUse = true")
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/fr/icdc/ebad/service/BatchService.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import fr.icdc.ebad.repository.SchedulingRepository;
import fr.icdc.ebad.security.SecurityUtils;
import fr.icdc.ebad.service.util.EbadServiceException;
import org.jobrunr.jobs.JobId;
import org.jobrunr.jobs.annotations.Job;
import org.jobrunr.scheduling.JobScheduler;
import org.slf4j.Logger;
Expand Down Expand Up @@ -254,7 +255,7 @@ public void deleteBatch(Long id) {
public void deleteScheduledJobFromBatch(Long batchId){
List<Scheduling> schedulings = schedulingRepository.findAllByBatchId(batchId);
schedulings.forEach(scheduling -> {
jobScheduler.delete(String.valueOf(scheduling.getId()));
jobScheduler.deleteRecurringJob(String.valueOf(scheduling.getId()));
schedulingRepository.delete(scheduling);
});
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/fr/icdc/ebad/service/EnvironnementService.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import fr.icdc.ebad.service.util.EbadServiceException;
import jakarta.annotation.Nullable;
import jakarta.validation.constraints.NotNull;
import org.jobrunr.jobs.JobId;
import org.jobrunr.scheduling.JobScheduler;
import org.pf4j.PluginRuntimeException;
import org.pf4j.PluginWrapper;
Expand Down Expand Up @@ -154,7 +155,7 @@ public String getEspaceDisque(Long id) {
public void deleteScheduledJobFromEnvironment(Long environmentId){
List<Scheduling> schedulings = schedulingRepository.findAllByEnvironnementId(environmentId);
schedulings.forEach(scheduling -> {
jobScheduler.delete(String.valueOf(scheduling.getId()));
jobScheduler.deleteRecurringJob(String.valueOf(scheduling.getId()));
schedulingRepository.delete(scheduling);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/fr/icdc/ebad/service/SchedulingService.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public Scheduling saveAndRun(Long batchId, Long environnementId, String paramete
@Transactional
public void remove(Long schedulingId) {
Scheduling scheduling = schedulingRepository.getById(schedulingId);
jobScheduler.delete(String.valueOf(scheduling.getId()));
jobScheduler.deleteRecurringJob(String.valueOf(scheduling.getId()));
schedulingRepository.delete(scheduling);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/fr/icdc/ebad/web/rest/errors/ApiError.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.databind.annotation.JsonTypeIdResolver;
import jakarta.validation.ConstraintViolation;
import lombok.Data;
import org.hibernate.validator.internal.engine.path.PathImpl;
import org.springframework.http.HttpStatus;
import org.springframework.validation.FieldError;
import org.springframework.validation.ObjectError;

import javax.validation.ConstraintViolation;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
Expand Down
Loading

0 comments on commit d2c1fd8

Please sign in to comment.