Skip to content

Commit

Permalink
🔥 refactor(QueryHelperTest.java): Remove unused JUnit test class.
Browse files Browse the repository at this point in the history
⬇️ refactor(`InfrastructureConfiguration.java`): Remove unused import.

🚀 refactor(`BootApplicationTest.java`): Update SpringBootTest annotation.

⬆️ refactor(`build.gradle`): Upgrade dependency-management plugin.

🔧 refactor(`platform/build.gradle`): Comment out Jooq implementation.

➖ refactor(`ContextUtils.java`): Remove JOOQDSL and related code.

🚨 refactor(`R2dbcConfiguration.java`): Remove DSLContext bean definition.
  • Loading branch information
vnobo committed Dec 22, 2024
1 parent c12cd59 commit 5c49980
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 30 deletions.
2 changes: 1 addition & 1 deletion boot/platform/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-redis-reactive")

//implementation("org.springframework.boot:spring-boot-starter-jooq")
implementation("org.jooq:jooq")
//implementation("org.jooq:jooq")
implementation("org.springframework.boot:spring-boot-starter-data-r2dbc")
implementation("org.postgresql:r2dbc-postgresql")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.plate.boot.security.SecurityDetails;
import com.plate.boot.security.core.user.UsersService;
import lombok.extern.log4j.Log4j2;
import org.jooq.DSLContext;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.http.HttpHeaders;
import org.springframework.http.server.reactive.ServerHttpRequest;
Expand Down Expand Up @@ -107,18 +106,15 @@ public final class ContextUtils implements InitializingBean {
*/
public static UsersService USERS_SERVICE;

public static DSLContext JOOQDSL;

/**
* Initializes the ContextUtils class with necessary dependencies.
*
* @param objectMapper The ObjectMapper instance used for JSON serialization and deserialization.
* @param usersService The UsersService instance to provide access to user-related operations.
*/
ContextUtils(ObjectMapper objectMapper, UsersService usersService, DSLContext create) {
ContextUtils(ObjectMapper objectMapper, UsersService usersService) {
ContextUtils.OBJECT_MAPPER = objectMapper;
ContextUtils.USERS_SERVICE = usersService;
ContextUtils.JOOQDSL = create;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@
import io.r2dbc.spi.ConnectionFactories;
import io.r2dbc.spi.ConnectionFactory;
import lombok.RequiredArgsConstructor;
import org.jooq.DSLContext;
import org.jooq.SQLDialect;
import org.jooq.impl.DSL;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.domain.ReactiveAuditorAware;
import org.springframework.data.r2dbc.config.AbstractR2dbcConfiguration;
import org.springframework.data.r2dbc.config.EnableR2dbcAuditing;
import org.springframework.lang.NonNull;
import org.springframework.r2dbc.connection.TransactionAwareConnectionFactoryProxy;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.util.List;
Expand Down Expand Up @@ -75,11 +71,4 @@ public ReactiveAuditorAware<UserAuditor> userAuditorProvider() {
return new UserAuditorAware();
}

@Bean
public DSLContext dslContext(ConnectionFactory connectionFactory) {
return DSL.using(
new TransactionAwareConnectionFactoryProxy(connectionFactory),
SQLDialect.POSTGRES
);
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.plate.boot;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

/**
* @author <a href="https://github.com/vnobo">Alex Bob</a>
*/
//@SpringBootTest(classes = InfrastructureConfiguration.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest
class BootApplicationTest {

@Test
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class, SecurityConfiguration.class})
@EnableTransactionManagement
public class InfrastructureConfiguration {

}
8 changes: 7 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'org.springframework.boot' version '3.4.1' apply false
id 'io.spring.dependency-management' version '1.1.6'
id 'io.spring.dependency-management' version '1.1.7'
id 'org.graalvm.buildtools.native' version '0.10.3'
}

Expand Down Expand Up @@ -36,6 +36,12 @@ configure(subprojects - project(":boot")) { project ->
]
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

configurations {
compileOnly {
extendsFrom annotationProcessor
Expand Down

0 comments on commit 5c49980

Please sign in to comment.