From d3eff8b73a4c40adf6dc2779342f81200a19800b Mon Sep 17 00:00:00 2001 From: roimenashe Date: Thu, 21 Dec 2023 14:09:18 +0200 Subject: [PATCH] Prepare 0.13.0 --- .github/workflows/build.yml | 4 +- README.adoc | 7 ++- pom.xml | 12 ++--- .../AerospikeCommonDataConfiguration.java | 44 ++++++++++++++- .../aerospike/AerospikeDataConfiguration.java | 53 +++++++++++++++---- .../aerospike/AerospikeDataProperties.java | 26 +++++++++ .../AerospikeReactiveDataConfiguration.java | 24 ++++++--- .../AerospikeDataAutoConfigurationTest.java | 19 +++---- ...pikeReactiveDataAutoConfigurationTest.java | 14 +++-- .../pom.xml | 2 +- 10 files changed, 154 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e46960..439ab84 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,10 +12,10 @@ jobs: steps: # Checkout repo using https://github.com/marketplace/actions/checkout - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: 17 diff --git a/README.adoc b/README.adoc index f7932d9..42fd256 100644 --- a/README.adoc +++ b/README.adoc @@ -9,6 +9,11 @@ image:https://github.com/aerospike-community/spring-data-aerospike-starters/work |=== |`spring-data-aerospike-starters` |`spring-data-aerospike` |`aerospike-client` |`aerospike-reactor-client` +|0.13.x +|4.6.x +|7.2.x +|7.1.x + |0.12.x |4.5.x |7.1.x @@ -76,7 +81,7 @@ Specify Aerospike server hosts and namespace: [source,properties] ---- spring.aerospike.hosts=aerospike-1-server-ip:3000,aerospike-2-server-ip:3000 -spring.data.aerospike.namespace=TEST +spring.data.aerospike.namespace=test ---- == Configuration options diff --git a/pom.xml b/pom.xml index 8cb00aa..0d2cd8a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.springframework.boot spring-boot-dependencies - 3.1.2 + 3.2.0 com.aerospike @@ -31,7 +31,7 @@ - 0.12.0 + 0.13.0 17 ${java.version} ${java.version} @@ -40,11 +40,11 @@ 1.6 1.5.0 - 4.5.0 - 7.0.0 - 7.1.0 + 4.6.0 + 7.1.0 + 7.2.0 - 4.0.4 + 4.1.0 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 f01a711..8eca8f0 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 @@ -1,11 +1,14 @@ package org.springframework.boot.autoconfigure.data.aerospike; +import com.aerospike.client.IAerospikeClient; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.domain.EntityScanner; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; +import org.springframework.data.aerospike.config.AerospikeDataSettings; import org.springframework.data.aerospike.convert.AerospikeCustomConversions; import org.springframework.data.aerospike.convert.AerospikeTypeAliasAccessor; import org.springframework.data.aerospike.convert.MappingAerospikeConverter; @@ -18,11 +21,13 @@ import org.springframework.data.aerospike.query.StatementBuilder; import org.springframework.data.aerospike.query.cache.IndexesCache; import org.springframework.data.aerospike.query.cache.IndexesCacheHolder; +import org.springframework.data.aerospike.server.version.ServerVersionSupport; import org.springframework.data.annotation.Persistent; import org.springframework.data.mapping.model.FieldNamingStrategy; import java.util.Collections; +@Slf4j @AutoConfiguration class AerospikeCommonDataConfiguration { @@ -54,8 +59,10 @@ public IndexesCacheHolder aerospikeIndexCache() { @ConditionalOnMissingBean(name = "mappingAerospikeConverter") public MappingAerospikeConverter mappingAerospikeConverter(AerospikeMappingContext aerospikeMappingContext, AerospikeTypeAliasAccessor aerospikeTypeAliasAccessor, - AerospikeCustomConversions aerospikeCustomConversions) { - return new MappingAerospikeConverter(aerospikeMappingContext, aerospikeCustomConversions, aerospikeTypeAliasAccessor); + AerospikeCustomConversions aerospikeCustomConversions, + AerospikeDataProperties aerospikeDataProperties) { + return new MappingAerospikeConverter(aerospikeMappingContext, aerospikeCustomConversions, + aerospikeTypeAliasAccessor, aerospikeDataSettings(aerospikeDataProperties)); } @Bean(name = "aerospikeTypeAliasAccessor") @@ -91,4 +98,37 @@ public AerospikeMappingContext aerospikeMappingContext(ApplicationContext applic public AerospikeExceptionTranslator aerospikeExceptionTranslator() { return new DefaultAerospikeExceptionTranslator(); } + + @Bean(name = "aerospikeServerVersionSupport") + public ServerVersionSupport serverVersionSupport(IAerospikeClient aerospikeClient, + AerospikeDataProperties aerospikeDataProperties) { + ServerVersionSupport serverVersionSupport = new ServerVersionSupport(aerospikeClient); + int serverVersionRefreshFrequency = + aerospikeDataSettings(aerospikeDataProperties).getServerVersionRefreshSeconds(); + processServerVersionRefreshFrequency(serverVersionRefreshFrequency, serverVersionSupport); + return serverVersionSupport; + } + + private void processServerVersionRefreshFrequency(int serverVersionRefreshSeconds, + ServerVersionSupport serverVersionSupport) { + if (serverVersionRefreshSeconds <= 0) { + log.info("Periodic server version refreshing is not scheduled, interval ({}) is <= 0", + serverVersionRefreshSeconds); + } else { + serverVersionSupport.scheduleServerVersionRefresh(serverVersionRefreshSeconds); + } + } + + private AerospikeDataSettings aerospikeDataSettings(AerospikeDataProperties aerospikeDataProperties) { + AerospikeDataSettings.AerospikeDataSettingsBuilder builder = AerospikeDataSettings.builder(); + configureDataSettings(builder, aerospikeDataProperties); + return builder.build(); + } + + private void configureDataSettings(AerospikeDataSettings.AerospikeDataSettingsBuilder builder, + AerospikeDataProperties aerospikeDataProperties) { + builder.scansEnabled(aerospikeDataProperties.isScansEnabled()); + builder.sendKey(aerospikeDataProperties.isSendKey()); + builder.createIndexesOnStartup(aerospikeDataProperties.isCreateIndexesOnStartup()); + } } diff --git a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataConfiguration.java b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataConfiguration.java index 8403459..1b22ab9 100644 --- a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataConfiguration.java +++ b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataConfiguration.java @@ -17,11 +17,13 @@ package org.springframework.boot.autoconfigure.data.aerospike; import com.aerospike.client.IAerospikeClient; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Lazy; +import org.springframework.data.aerospike.config.AerospikeDataSettings; import org.springframework.data.aerospike.convert.MappingAerospikeConverter; import org.springframework.data.aerospike.core.AerospikeExceptionTranslator; import org.springframework.data.aerospike.core.AerospikeTemplate; @@ -35,6 +37,7 @@ import org.springframework.data.aerospike.query.cache.IndexRefresher; import org.springframework.data.aerospike.query.cache.IndexesCacheUpdater; import org.springframework.data.aerospike.query.cache.InternalIndexOperations; +import org.springframework.data.aerospike.server.version.ServerVersionSupport; /** * Configure Spring Data's Aerospike support. @@ -42,6 +45,7 @@ * @author Igor Ermolenko * @author Anastasiia Smirnova */ +@Slf4j @AutoConfiguration class AerospikeDataConfiguration { @@ -52,12 +56,10 @@ public AerospikeTemplate aerospikeTemplate(IAerospikeClient aerospikeClient, MappingAerospikeConverter mappingAerospikeConverter, AerospikeMappingContext aerospikeMappingContext, AerospikeExceptionTranslator aerospikeExceptionTranslator, - QueryEngine queryEngine, IndexRefresher indexRefresher) { - return new AerospikeTemplate(aerospikeClient, - aerospikeDataProperties.getNamespace(), - mappingAerospikeConverter, - aerospikeMappingContext, - aerospikeExceptionTranslator, queryEngine, indexRefresher); + QueryEngine queryEngine, IndexRefresher indexRefresher, + ServerVersionSupport serverVersionSupport) { + return new AerospikeTemplate(aerospikeClient, aerospikeDataProperties.getNamespace(), mappingAerospikeConverter, + aerospikeMappingContext, aerospikeExceptionTranslator, queryEngine, indexRefresher, serverVersionSupport); } @Bean(name = "aerospikeQueryEngine") @@ -66,26 +68,55 @@ public QueryEngine aerospikeQueryEngine(IAerospikeClient aerospikeClient, AerospikeDataProperties aerospikeDataProperties, FilterExpressionsBuilder filterExpressionsBuilder, StatementBuilder statementBuilder) { - QueryEngine queryEngine = new QueryEngine(aerospikeClient, statementBuilder, filterExpressionsBuilder, aerospikeClient.getQueryPolicyDefault()); + QueryEngine queryEngine = new QueryEngine(aerospikeClient, statementBuilder, filterExpressionsBuilder); queryEngine.setScansEnabled(aerospikeDataProperties.isScansEnabled()); + queryEngine.setQueryMaxRecords(aerospikeDataProperties.getQueryMaxRecords()); return queryEngine; } @Bean(name = "aerospikeIndexRefresher") @ConditionalOnMissingBean(name = "aerospikeIndexRefresher") - public IndexRefresher aerospikeIndexRefresher(IAerospikeClient aerospikeClient, IndexesCacheUpdater indexesCacheUpdater) { - IndexRefresher refresher = new IndexRefresher(aerospikeClient, aerospikeClient.getInfoPolicyDefault(), new InternalIndexOperations(new IndexInfoParser()), indexesCacheUpdater); + public IndexRefresher indexRefresher(IAerospikeClient aerospikeClient, IndexesCacheUpdater indexesCacheUpdater, + ServerVersionSupport serverVersionSupport, + AerospikeDataProperties aerospikeDataProperties) { + IndexRefresher refresher = new IndexRefresher(aerospikeClient, aerospikeClient.getInfoPolicyDefault(), + new InternalIndexOperations(new IndexInfoParser()), indexesCacheUpdater, serverVersionSupport); refresher.refreshIndexes(); + int refreshFrequency = aerospikeDataSettings(aerospikeDataProperties).getIndexCacheRefreshSeconds(); + processCacheRefreshFrequency(refreshFrequency, refresher); return refresher; } + private void processCacheRefreshFrequency(int indexCacheRefreshSeconds, IndexRefresher indexRefresher) { + if (indexCacheRefreshSeconds <= 0) { + log.info("Periodic index cache refreshing is not scheduled, interval ({}) is <= 0", + indexCacheRefreshSeconds); + } else { + indexRefresher.scheduleRefreshIndexes(indexCacheRefreshSeconds); + } + } + @Bean @ConditionalOnMissingBean(name = "aerospikePersistenceEntityIndexCreator") public AerospikePersistenceEntityIndexCreator aerospikePersistenceEntityIndexCreator( AerospikeDataProperties aerospikeDataProperties, - @Lazy AerospikeTemplate template, + @Lazy ObjectProvider template, ObjectProvider aerospikeMappingContext, AerospikeIndexResolver aerospikeIndexResolver) { - return new AerospikePersistenceEntityIndexCreator(aerospikeMappingContext, aerospikeDataProperties.isCreateIndexesOnStartup(), aerospikeIndexResolver, template); + return new AerospikePersistenceEntityIndexCreator(aerospikeMappingContext, + aerospikeDataProperties.isCreateIndexesOnStartup(), aerospikeIndexResolver, template); + } + + private AerospikeDataSettings aerospikeDataSettings(AerospikeDataProperties aerospikeDataProperties) { + AerospikeDataSettings.AerospikeDataSettingsBuilder builder = AerospikeDataSettings.builder(); + configureDataSettings(builder, aerospikeDataProperties); + return builder.build(); + } + + private void configureDataSettings(AerospikeDataSettings.AerospikeDataSettingsBuilder builder, + AerospikeDataProperties aerospikeDataProperties) { + builder.scansEnabled(aerospikeDataProperties.isScansEnabled()); + builder.sendKey(aerospikeDataProperties.isSendKey()); + builder.createIndexesOnStartup(aerospikeDataProperties.isCreateIndexesOnStartup()); } } diff --git a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataProperties.java b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataProperties.java index 1f62881..f919a48 100644 --- a/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataProperties.java +++ b/spring-boot-autoconfigure-data-aerospike/src/main/java/org/springframework/boot/autoconfigure/data/aerospike/AerospikeDataProperties.java @@ -45,6 +45,11 @@ public class AerospikeDataProperties { */ private boolean scansEnabled = false; + /** + * Limit amount of results returned by server. Non-positive value means no limit. + */ + private long queryMaxRecords = 10_000L; + /** * Specifies fully qualified name of the FieldNamingStrategy for the entities. */ @@ -55,6 +60,11 @@ public class AerospikeDataProperties { */ private boolean createIndexesOnStartup = true; + /** + * Send user defined key in addition to hash digest on both reads and writes + */ + private boolean sendKey = true; + public String getNamespace() { return namespace; } @@ -79,6 +89,14 @@ public void setScansEnabled(boolean scansEnabled) { this.scansEnabled = scansEnabled; } + public long getQueryMaxRecords() { + return queryMaxRecords; + } + + public void setQueryMaxRecords(long queryMaxRecords) { + this.queryMaxRecords = queryMaxRecords; + } + public Class getFieldNamingStrategy() { return fieldNamingStrategy; } @@ -94,4 +112,12 @@ public boolean isCreateIndexesOnStartup() { public void setCreateIndexesOnStartup(boolean createIndexesOnStartup) { this.createIndexesOnStartup = createIndexesOnStartup; } + + public boolean isSendKey() { + return sendKey; + } + + public void setSendKey(boolean sendKey) { + this.sendKey = sendKey; + } } 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 33c0680..470b666 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 @@ -35,6 +35,7 @@ import org.springframework.data.aerospike.query.cache.IndexesCacheUpdater; import org.springframework.data.aerospike.query.cache.InternalIndexOperations; import org.springframework.data.aerospike.query.cache.ReactorIndexRefresher; +import org.springframework.data.aerospike.server.version.ServerVersionSupport; /** * Configure Spring Data's Reactive Aerospike support. @@ -52,9 +53,12 @@ public ReactiveAerospikeTemplate reactiveAerospikeTemplate(MappingAerospikeConve AerospikeMappingContext aerospikeMappingContext, AerospikeExceptionTranslator aerospikeExceptionTranslator, AerospikeReactorClient aerospikeReactorClient, - ReactorQueryEngine reactorQueryEngine, ReactorIndexRefresher reactorIndexRefresher) { - return new ReactiveAerospikeTemplate(aerospikeReactorClient, aerospikeDataProperties.getNamespace(), mappingAerospikeConverter, aerospikeMappingContext, - aerospikeExceptionTranslator, reactorQueryEngine, reactorIndexRefresher); + ReactorQueryEngine reactorQueryEngine, + ReactorIndexRefresher reactorIndexRefresher, + ServerVersionSupport serverVersionSupport) { + return new ReactiveAerospikeTemplate(aerospikeReactorClient, aerospikeDataProperties.getNamespace(), + mappingAerospikeConverter, aerospikeMappingContext, + aerospikeExceptionTranslator, reactorQueryEngine, reactorIndexRefresher, serverVersionSupport); } @Bean(name = "reactiveAerospikeQueryEngine") @@ -63,17 +67,20 @@ public ReactorQueryEngine reactiveAerospikeQueryEngine(AerospikeReactorClient ae AerospikeDataProperties aerospikeDataProperties, FilterExpressionsBuilder filterExpressionsBuilder, StatementBuilder statementBuilder) { - ReactorQueryEngine queryEngine = new ReactorQueryEngine(aerospikeReactorClient, statementBuilder, filterExpressionsBuilder, aerospikeReactorClient.getQueryPolicyDefault()); + ReactorQueryEngine queryEngine = new ReactorQueryEngine(aerospikeReactorClient, statementBuilder, + filterExpressionsBuilder); queryEngine.setScansEnabled(aerospikeDataProperties.isScansEnabled()); + queryEngine.setQueryMaxRecords(aerospikeDataProperties.getQueryMaxRecords()); return queryEngine; } @Bean(name = "reactiveAerospikeIndexRefresher") @ConditionalOnMissingBean(name = "reactiveAerospikeIndexRefresher") public ReactorIndexRefresher reactiveAerospikeIndexRefresher(AerospikeReactorClient aerospikeReactorClient, - IndexesCacheUpdater indexesCacheUpdater) { + IndexesCacheUpdater indexesCacheUpdater, + ServerVersionSupport serverVersionSupport) { ReactorIndexRefresher refresher = new ReactorIndexRefresher(aerospikeReactorClient, aerospikeReactorClient.getInfoPolicyDefault(), - new InternalIndexOperations(new IndexInfoParser()), indexesCacheUpdater); + new InternalIndexOperations(new IndexInfoParser()), indexesCacheUpdater, serverVersionSupport); refresher.refreshIndexes().block(); return refresher; } @@ -82,10 +89,11 @@ public ReactorIndexRefresher reactiveAerospikeIndexRefresher(AerospikeReactorCli @ConditionalOnMissingBean(name = "reactiveAerospikePersistenceEntityIndexCreator") public ReactiveAerospikePersistenceEntityIndexCreator reactiveAerospikePersistenceEntityIndexCreator( AerospikeDataProperties aerospikeDataProperties, - @Lazy ReactiveAerospikeTemplate template, + @Lazy ObjectProvider template, ObjectProvider aerospikeMappingContext, AerospikeIndexResolver aerospikeIndexResolver) { - return new ReactiveAerospikePersistenceEntityIndexCreator(aerospikeMappingContext, aerospikeDataProperties.isCreateIndexesOnStartup(), + return new ReactiveAerospikePersistenceEntityIndexCreator(aerospikeMappingContext, + aerospikeDataProperties.isCreateIndexesOnStartup(), aerospikeIndexResolver, template); } 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 15f1d67..565d952 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 @@ -32,9 +32,6 @@ import org.springframework.data.aerospike.core.ReactiveAerospikeTemplate; import org.springframework.data.aerospike.mapping.AerospikeMappingContext; import org.springframework.data.util.TypeInformation; -import org.springframework.test.util.ReflectionTestUtils; - -import java.util.Set; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.autoconfigure.data.aerospike.AerospikeTestConfigurations.AerospikeClientMockConfiguration; @@ -49,7 +46,7 @@ */ public class AerospikeDataAutoConfigurationTest { - private ApplicationContextRunner contextRunner = new ApplicationContextRunner() + private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withClassLoader(new FilteredClassLoader(AerospikeReactorClient.class)) .withConfiguration(AutoConfigurations.of( AerospikeAutoConfiguration.class, AerospikeDataAutoConfiguration.class)); @@ -65,11 +62,10 @@ public void aerospikeTemplateAndClientAreNotSetupWhenNeitherClientNorDataPropert } @Test - @SuppressWarnings("unchecked") public void entityScanShouldSetInitialEntitySet() { contextRunner .withPropertyValues("spring.aerospike.hosts=localhost:3000") - .withPropertyValues("spring.data.aerospike.namespace=TEST") + .withPropertyValues("spring.data.aerospike.namespace=test") .withUserConfiguration(EntityScanConfiguration.class, AerospikeClientMockConfiguration.class) .run(context -> { AerospikeMappingContext mappingContext = context.getBean(AerospikeMappingContext.class); @@ -81,7 +77,7 @@ public void entityScanShouldSetInitialEntitySet() { public void typeKeyDefault() { contextRunner .withPropertyValues("spring.aerospike.hosts=localhost:3000") - .withPropertyValues("spring.data.aerospike.namespace=TEST") + .withPropertyValues("spring.data.aerospike.namespace=test") .withUserConfiguration(AerospikeClientMockConfiguration.class) .run(context -> { AerospikeTypeAliasAccessor aliasAccessor = context.getBean(AerospikeTypeAliasAccessor.class); @@ -96,7 +92,7 @@ public void typeKeyDefault() { public void typeKeyCanBeCustomized() { contextRunner .withPropertyValues("spring.aerospike.hosts=localhost:3000") - .withPropertyValues("spring.data.aerospike.namespace=TEST") + .withPropertyValues("spring.data.aerospike.namespace=test") .withUserConfiguration(AerospikeClientMockConfiguration.class) .withPropertyValues("spring.data.aerospike.type-key=++amazing++") .run((context) -> { @@ -111,7 +107,7 @@ public void typeKeyCanBeCustomized() { public void typeKeyCanBeNull() { contextRunner .withPropertyValues("spring.aerospike.hosts=localhost:3000") - .withPropertyValues("spring.data.aerospike.namespace=TEST") + .withPropertyValues("spring.data.aerospike.namespace=test") .withUserConfiguration(AerospikeClientMockConfiguration.class) .withPropertyValues("spring.data.aerospike.type-key=") .run((context) -> { @@ -126,7 +122,7 @@ public void typeKeyCanBeNull() { public void customConversions() { contextRunner .withPropertyValues("spring.aerospike.hosts=localhost:3000") - .withPropertyValues("spring.data.aerospike.namespace=TEST") + .withPropertyValues("spring.data.aerospike.namespace=test") .withUserConfiguration(CustomConversionsConfig.class, AerospikeClientMockConfiguration.class) .run(context -> { MappingAerospikeConverter converter = context.getBean(MappingAerospikeConverter.class); @@ -138,7 +134,7 @@ public void customConversions() { public void configurationIsApplied() { contextRunner .withPropertyValues("spring.aerospike.hosts=localhost:3000") - .withPropertyValues("spring.data.aerospike.namespace=TEST") + .withPropertyValues("spring.data.aerospike.namespace=test") .withUserConfiguration(AerospikeClientMockConfiguration.class) .run(context -> { assertThat(context).doesNotHaveBean(ReactiveAerospikeTemplate.class); @@ -148,5 +144,4 @@ public void configurationIsApplied() { assertThat(context).hasSingleBean(AerospikeMappingContext.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 339f6ac..ee0e487 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 @@ -43,7 +43,7 @@ */ public class AerospikeReactiveDataAutoConfigurationTest { - private ApplicationContextRunner contextRunner = new ApplicationContextRunner() + private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withConfiguration(AutoConfigurations.of( AerospikeAutoConfiguration.class, AerospikeReactiveDataAutoConfiguration.class)); @@ -59,11 +59,10 @@ public void aerospikeTemplateAndClientAreNotSetupWhenNeitherClientNorDataPropert } @Test - @SuppressWarnings("unchecked") public void entityScanShouldSetInitialEntitySet() { contextRunner .withPropertyValues("spring.aerospike.hosts=localhost:3000") - .withPropertyValues("spring.data.aerospike.namespace=TEST") + .withPropertyValues("spring.data.aerospike.namespace=test") .withUserConfiguration(AerospikeTestConfigurations.EntityScanConfiguration.class, AerospikeClientMockConfiguration.class, MockReactiveIndexRefresher.class) .run(context -> { AerospikeMappingContext mappingContext = context.getBean(AerospikeMappingContext.class); @@ -75,7 +74,7 @@ public void entityScanShouldSetInitialEntitySet() { public void typeKeyDefault() { contextRunner .withPropertyValues("spring.aerospike.hosts=localhost:3000") - .withPropertyValues("spring.data.aerospike.namespace=TEST") + .withPropertyValues("spring.data.aerospike.namespace=test") .withUserConfiguration(AerospikeClientMockConfiguration.class, MockReactiveIndexRefresher.class) .run(context -> { AerospikeTypeAliasAccessor aliasAccessor = context.getBean(AerospikeTypeAliasAccessor.class); @@ -90,7 +89,7 @@ public void typeKeyDefault() { public void typeKeyCanBeCustomized() { contextRunner .withPropertyValues("spring.aerospike.hosts=localhost:3000") - .withPropertyValues("spring.data.aerospike.namespace=TEST") + .withPropertyValues("spring.data.aerospike.namespace=test") .withUserConfiguration(AerospikeClientMockConfiguration.class, MockReactiveIndexRefresher.class) .withPropertyValues("spring.data.aerospike.type-key=++amazing++") .run((context) -> { @@ -105,7 +104,7 @@ public void typeKeyCanBeCustomized() { public void customConversions() { contextRunner .withPropertyValues("spring.aerospike.hosts=localhost:3000") - .withPropertyValues("spring.data.aerospike.namespace=TEST") + .withPropertyValues("spring.data.aerospike.namespace=test") .withUserConfiguration(AerospikeTestConfigurations.CustomConversionsConfig.class, AerospikeClientMockConfiguration.class, MockReactiveIndexRefresher.class) .run(context -> { MappingAerospikeConverter converter = context.getBean(MappingAerospikeConverter.class); @@ -117,7 +116,7 @@ public void customConversions() { public void configurationIsApplied() { contextRunner .withPropertyValues("spring.aerospike.hosts=localhost:3000") - .withPropertyValues("spring.data.aerospike.namespace=TEST") + .withPropertyValues("spring.data.aerospike.namespace=test") .withUserConfiguration(AerospikeClientMockConfiguration.class, MockReactiveIndexRefresher.class) .run(context -> { assertThat(context).doesNotHaveBean(AerospikeTemplate.class); @@ -127,5 +126,4 @@ public void configurationIsApplied() { assertThat(context).hasSingleBean(AerospikeMappingContext.class); }); } - } diff --git a/spring-boot-starter-data-aerospike-example/pom.xml b/spring-boot-starter-data-aerospike-example/pom.xml index 842d16d..24dd73e 100644 --- a/spring-boot-starter-data-aerospike-example/pom.xml +++ b/spring-boot-starter-data-aerospike-example/pom.xml @@ -16,7 +16,7 @@ Example for using Spring Boot Data Aerospike Starter - 2.3.2 + 3.1.1