From 13a2f22af439e7b67f6acb9d2b3b602ffbcff675 Mon Sep 17 00:00:00 2001 From: agrgr Date: Wed, 25 Sep 2024 17:30:29 +0300 Subject: [PATCH] update configuration --- .../aerospike/AerospikeAutoConfiguration.java | 4 ++-- .../AerospikeCommonDataConfiguration.java | 7 ------- .../aerospike/AerospikeDataAutoConfiguration.java | 5 ++--- .../AerospikeReactiveDataAutoConfiguration.java | 6 +++--- .../AerospikeReactiveDataConfiguration.java | 8 ++++---- ...spikeReactiveRepositoriesAutoConfiguration.java | 4 ++-- .../AerospikeRepositoriesAutoConfiguration.java | 4 ++-- .../AerospikeDataAutoConfigurationTest.java | 4 ++-- ...AerospikeReactiveDataAutoConfigurationTest.java | 4 ++-- .../example/reactive/ReactiveIntegrationTest.java | 6 ++---- .../example/sync/SyncIntegrationTest.java | 14 +++----------- 11 files changed, 24 insertions(+), 42 deletions(-) diff --git a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/aerospike/AerospikeAutoConfiguration.java b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/aerospike/AerospikeAutoConfiguration.java index 637931f..969d4c1 100644 --- a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/aerospike/AerospikeAutoConfiguration.java +++ b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/aerospike/AerospikeAutoConfiguration.java @@ -42,7 +42,7 @@ * @author Anastasiia Smirnova */ @AutoConfiguration -@ConditionalOnClass(AerospikeClient.class) +@ConditionalOnClass(IAerospikeClient.class) @ConditionalOnProperty("spring.aerospike.hosts") @EnableConfigurationProperties(AerospikeProperties.class) public class AerospikeAutoConfiguration { @@ -85,7 +85,7 @@ public ClientPolicy aerospikeClientPolicy(AerospikeProperties properties, return clientPolicy; } - @ConditionalOnClass({AerospikeReactorClient.class, Flux.class}) + @ConditionalOnClass({IAerospikeReactorClient.class, Flux.class}) public static class AerospikeReactiveAutoConfiguration { @Bean(name = "aerospikeReactorClient", destroyMethod = "") diff --git a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeCommonDataConfiguration.java b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeCommonDataConfiguration.java index 05f96aa..49ee135 100644 --- a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeCommonDataConfiguration.java +++ b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeCommonDataConfiguration.java @@ -8,8 +8,6 @@ import org.springframework.boot.autoconfigure.domain.EntityScanner; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; -import org.springframework.data.aerospike.cache.AerospikeCacheKeyProcessor; -import org.springframework.data.aerospike.cache.AerospikeCacheKeyProcessorImpl; import org.springframework.data.aerospike.config.AerospikeConnectionSettings; import org.springframework.data.aerospike.config.AerospikeDataSettings; import org.springframework.data.aerospike.config.AerospikeSettings; @@ -75,11 +73,6 @@ public IndexesCacheHolder aerospikeIndexCache() { return new IndexesCacheHolder(); } - @Bean(name = "aerospikeCacheKeyProcessor") - public AerospikeCacheKeyProcessor cacheKeyProcessor() { - return new AerospikeCacheKeyProcessorImpl(); - } - @Bean(name = "mappingAerospikeConverter") @ConditionalOnMissingBean(name = "mappingAerospikeConverter") public MappingAerospikeConverter mappingAerospikeConverter(AerospikeMappingContext aerospikeMappingContext, diff --git a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataAutoConfiguration.java b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataAutoConfiguration.java index 729760c..4239371 100644 --- a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataAutoConfiguration.java +++ b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataAutoConfiguration.java @@ -16,7 +16,6 @@ package org.springframework.boot.autoconfigure.data.aerospike; -import com.aerospike.client.AerospikeClient; import com.aerospike.client.IAerospikeClient; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; @@ -39,8 +38,8 @@ @AutoConfiguration // match only if we do not have reactive client // we want sync context to be loaded when only sync client is on classpath -@ConditionalOnMissingClass("com.aerospike.client.reactor.AerospikeReactorClient") -@ConditionalOnClass({AerospikeClient.class, AerospikeRepository.class}) +@ConditionalOnMissingClass("com.aerospike.client.reactor.IAerospikeReactorClient") +@ConditionalOnClass({IAerospikeClient.class, AerospikeRepository.class}) @ConditionalOnSingleCandidate(IAerospikeClient.class) @ConditionalOnProperty("spring.data.aerospike.namespace") @EnableConfigurationProperties(AerospikeDataProperties.class) diff --git a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeReactiveDataAutoConfiguration.java b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeReactiveDataAutoConfiguration.java index 489cfa5..fe9608e 100644 --- a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeReactiveDataAutoConfiguration.java +++ b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeReactiveDataAutoConfiguration.java @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.data.aerospike; -import com.aerospike.client.reactor.AerospikeReactorClient; +import com.aerospike.client.reactor.IAerospikeReactorClient; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -36,8 +36,8 @@ * @author Anastasiia Smirnova */ @AutoConfiguration -@ConditionalOnClass({AerospikeReactorClient.class, ReactiveAerospikeRepository.class, Flux.class}) -@ConditionalOnSingleCandidate(AerospikeReactorClient.class) +@ConditionalOnClass({IAerospikeReactorClient.class, ReactiveAerospikeRepository.class, Flux.class}) +@ConditionalOnSingleCandidate(IAerospikeReactorClient.class) @ConditionalOnProperty("spring.data.aerospike.namespace") @AutoConfigureAfter(AerospikeAutoConfiguration.class) @EnableConfigurationProperties(AerospikeDataProperties.class) diff --git a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeReactiveDataConfiguration.java b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeReactiveDataConfiguration.java index 1df8034..24872e6 100644 --- a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeReactiveDataConfiguration.java +++ b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeReactiveDataConfiguration.java @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.data.aerospike; -import com.aerospike.client.reactor.AerospikeReactorClient; +import com.aerospike.client.reactor.IAerospikeReactorClient; import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -53,7 +53,7 @@ public ReactiveAerospikeTemplate reactiveAerospikeTemplate(MappingAerospikeConve AerospikeDataProperties aerospikeDataProperties, AerospikeMappingContext aerospikeMappingContext, AerospikeExceptionTranslator aerospikeExceptionTranslator, - AerospikeReactorClient aerospikeReactorClient, + IAerospikeReactorClient aerospikeReactorClient, ReactorQueryEngine reactorQueryEngine, ReactorIndexRefresher reactorIndexRefresher, ServerVersionSupport serverVersionSupport) { @@ -64,7 +64,7 @@ public ReactiveAerospikeTemplate reactiveAerospikeTemplate(MappingAerospikeConve @Bean(name = "reactiveAerospikeQueryEngine") @ConditionalOnMissingBean(name = "reactiveAerospikeQueryEngine") - public ReactorQueryEngine reactiveAerospikeQueryEngine(AerospikeReactorClient aerospikeReactorClient, + public ReactorQueryEngine reactiveAerospikeQueryEngine(IAerospikeReactorClient aerospikeReactorClient, AerospikeDataProperties aerospikeDataProperties, FilterExpressionsBuilder filterExpressionsBuilder, StatementBuilder statementBuilder, @@ -78,7 +78,7 @@ public ReactorQueryEngine reactiveAerospikeQueryEngine(AerospikeReactorClient ae @Bean(name = "reactiveAerospikeIndexRefresher") @ConditionalOnMissingBean(name = "reactiveAerospikeIndexRefresher") - public ReactorIndexRefresher reactiveAerospikeIndexRefresher(AerospikeReactorClient aerospikeReactorClient, + public ReactorIndexRefresher reactiveAerospikeIndexRefresher(IAerospikeReactorClient aerospikeReactorClient, IndexesCacheUpdater indexesCacheUpdater, ServerVersionSupport serverVersionSupport) { ReactorIndexRefresher refresher = new ReactorIndexRefresher(aerospikeReactorClient, aerospikeReactorClient.getInfoPolicyDefault(), diff --git a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeReactiveRepositoriesAutoConfiguration.java b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeReactiveRepositoriesAutoConfiguration.java index 7cb3c83..c285d38 100644 --- a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeReactiveRepositoriesAutoConfiguration.java +++ b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeReactiveRepositoriesAutoConfiguration.java @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.data.aerospike; -import com.aerospike.client.reactor.AerospikeReactorClient; +import com.aerospike.client.reactor.IAerospikeReactorClient; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -34,7 +34,7 @@ * @author Igor Ermolenko */ @AutoConfiguration -@ConditionalOnClass({AerospikeReactorClient.class, ReactiveAerospikeRepository.class, Flux.class}) +@ConditionalOnClass({IAerospikeReactorClient.class, ReactiveAerospikeRepository.class, Flux.class}) @ConditionalOnRepositoryType(store = "aerospike", type = RepositoryType.REACTIVE) @ConditionalOnMissingBean(ReactiveAerospikeRepositoryFactoryBean.class) @Import(AerospikeReactiveRepositoriesRegistrar.class) diff --git a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeRepositoriesAutoConfiguration.java b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeRepositoriesAutoConfiguration.java index fca92c6..268ec76 100644 --- a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeRepositoriesAutoConfiguration.java +++ b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeRepositoriesAutoConfiguration.java @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.data.aerospike; -import com.aerospike.client.AerospikeClient; +import com.aerospike.client.IAerospikeClient; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -33,7 +33,7 @@ * @author Igor Ermolenko */ @AutoConfiguration -@ConditionalOnClass({AerospikeClient.class, ReactiveAerospikeRepository.class}) +@ConditionalOnClass({IAerospikeClient.class, ReactiveAerospikeRepository.class}) @ConditionalOnRepositoryType(store = "aerospike", type = RepositoryType.IMPERATIVE) @ConditionalOnMissingBean(AerospikeRepositoryFactoryBean.class) @Import(AerospikeRepositoriesRegistrar.class) diff --git a/spring-boot-autoconfigure-data-aerospike/src/test/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataAutoConfigurationTest.java b/spring-boot-autoconfigure-data-aerospike/src/test/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataAutoConfigurationTest.java index 9e392b1..3dde1eb 100644 --- a/spring-boot-autoconfigure-data-aerospike/src/test/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataAutoConfigurationTest.java +++ b/spring-boot-autoconfigure-data-aerospike/src/test/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataAutoConfigurationTest.java @@ -17,7 +17,7 @@ package org.springframework.boot.autoconfigure.data.aerospike; import com.aerospike.client.AerospikeClient; -import com.aerospike.client.reactor.AerospikeReactorClient; +import com.aerospike.client.reactor.IAerospikeReactorClient; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.aerospike.AerospikeAutoConfiguration; @@ -49,7 +49,7 @@ public class AerospikeDataAutoConfigurationTest { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() - .withClassLoader(new FilteredClassLoader(AerospikeReactorClient.class)) + .withClassLoader(new FilteredClassLoader(IAerospikeReactorClient.class)) .withConfiguration(AutoConfigurations.of( AerospikeAutoConfiguration.class, AerospikeDataAutoConfiguration.class)); diff --git a/spring-boot-autoconfigure-data-aerospike/src/test/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeReactiveDataAutoConfigurationTest.java b/spring-boot-autoconfigure-data-aerospike/src/test/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeReactiveDataAutoConfigurationTest.java index 10fdcc6..1f1d421 100644 --- a/spring-boot-autoconfigure-data-aerospike/src/test/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeReactiveDataAutoConfigurationTest.java +++ b/spring-boot-autoconfigure-data-aerospike/src/test/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeReactiveDataAutoConfigurationTest.java @@ -16,7 +16,7 @@ package org.springframework.boot.autoconfigure.data.aerospike; -import com.aerospike.client.AerospikeClient; +import com.aerospike.client.IAerospikeClient; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.aerospike.AerospikeAutoConfiguration; @@ -52,7 +52,7 @@ public class AerospikeReactiveDataAutoConfigurationTest { @Test public void aerospikeTemplateAndClientAreNotSetupWhenNeitherClientNorDataPropertiesConfigured() { contextRunner.run(context -> { - assertThat(context).doesNotHaveBean(AerospikeClient.class); + assertThat(context).doesNotHaveBean(IAerospikeClient.class); assertThat(context).doesNotHaveBean(AerospikeTemplate.class); assertThat(context).doesNotHaveBean(ReactiveAerospikeTemplate.class); assertThat(context).doesNotHaveBean(AerospikeDataProperties.class); diff --git a/spring-boot-starter-data-aerospike-example/reactive/src/test/java/com/aerospike/example/reactive/ReactiveIntegrationTest.java b/spring-boot-starter-data-aerospike-example/reactive/src/test/java/com/aerospike/example/reactive/ReactiveIntegrationTest.java index 75bf769..67c092b 100644 --- a/spring-boot-starter-data-aerospike-example/reactive/src/test/java/com/aerospike/example/reactive/ReactiveIntegrationTest.java +++ b/spring-boot-starter-data-aerospike-example/reactive/src/test/java/com/aerospike/example/reactive/ReactiveIntegrationTest.java @@ -61,8 +61,7 @@ void savesAndGets() { .assertThat() .statusCode(200) .body("id", equalTo("andrea")) - .body("age", equalTo(61)) - ; + .body("age", equalTo(61)); } @Order(2) @@ -82,7 +81,6 @@ void savesAndFindsByLastName() { .assertThat() .statusCode(200) .body("[0].id", equalTo("andrea")) - .body("[0].age", equalTo(61)) - ; + .body("[0].age", equalTo(61)); } } diff --git a/spring-boot-starter-data-aerospike-example/sync/src/test/java/com/aerospike/example/sync/SyncIntegrationTest.java b/spring-boot-starter-data-aerospike-example/sync/src/test/java/com/aerospike/example/sync/SyncIntegrationTest.java index 018d636..bde468a 100644 --- a/spring-boot-starter-data-aerospike-example/sync/src/test/java/com/aerospike/example/sync/SyncIntegrationTest.java +++ b/spring-boot-starter-data-aerospike-example/sync/src/test/java/com/aerospike/example/sync/SyncIntegrationTest.java @@ -2,12 +2,7 @@ import io.restassured.RestAssured; import io.restassured.http.ContentType; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.MethodOrderer; -import org.junit.jupiter.api.Order; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestMethodOrder; +import org.junit.jupiter.api.*; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.server.LocalServerPort; @@ -66,8 +61,7 @@ void savesAndGets() { .assertThat() .statusCode(200) .body("id", equalTo("andrea")) - .body("age", equalTo(61)) - ; + .body("age", equalTo(61)); } @Order(2) @@ -87,8 +81,6 @@ void savesAndFindsByLastName() { .assertThat() .statusCode(200) .body("[0].id", equalTo("andrea")) - .body("[0].age", equalTo(61)) - ; + .body("[0].age", equalTo(61)); } - }