From 1017b80578d76d19ba2e96928671dad860ed8d5e Mon Sep 17 00:00:00 2001 From: Michael Lueders Date: Sun, 3 Oct 2021 16:14:55 -0500 Subject: [PATCH] do not Autowired cosmosTemplate --- .../spring/data/cosmos/core/CosmosTemplateIT.java | 10 +++++----- .../data/cosmos/core/ReactiveCosmosTemplateIT.java | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sdk/cosmos/azure-spring-data-cosmos-test/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIT.java b/sdk/cosmos/azure-spring-data-cosmos-test/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIT.java index 096191701db14..a06887c999e06 100644 --- a/sdk/cosmos/azure-spring-data-cosmos-test/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos-test/src/test/java/com/azure/spring/data/cosmos/core/CosmosTemplateIT.java @@ -663,20 +663,20 @@ public void createWithAutoscale() throws ClassNotFoundException { @Test public void createDatabaseWithThroughput() throws ClassNotFoundException { - final String dbName = TestConstants.DB_NAME + "-other"; - deleteDatabaseIfExists(dbName); + final String configuredThroughputDbName = TestConstants.DB_NAME + "-configured-throughput"; + deleteDatabaseIfExists(configuredThroughputDbName); Integer expectedRequestUnits = 700; final CosmosConfig config = CosmosConfig.builder() .enableDatabaseThroughput(false, expectedRequestUnits) .build(); - cosmosTemplate = createCosmosTemplate(config, dbName); + final CosmosTemplate configuredThroughputCosmosTemplate = createCosmosTemplate(config, configuredThroughputDbName); final CosmosEntityInformation personInfo = new CosmosEntityInformation<>(Person.class); - cosmosTemplate.createContainerIfNotExists(personInfo); + configuredThroughputCosmosTemplate.createContainerIfNotExists(personInfo); - final CosmosAsyncDatabase database = client.getDatabase(dbName); + final CosmosAsyncDatabase database = client.getDatabase(configuredThroughputDbName); final ThroughputResponse response = database.readThroughput().block(); assertEquals(expectedRequestUnits, response.getProperties().getManualThroughput()); } diff --git a/sdk/cosmos/azure-spring-data-cosmos-test/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplateIT.java b/sdk/cosmos/azure-spring-data-cosmos-test/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplateIT.java index 5a0c006e55f47..ae4676eb498c1 100644 --- a/sdk/cosmos/azure-spring-data-cosmos-test/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplateIT.java +++ b/sdk/cosmos/azure-spring-data-cosmos-test/src/test/java/com/azure/spring/data/cosmos/core/ReactiveCosmosTemplateIT.java @@ -549,20 +549,20 @@ public void createWithAutoscale() { @Test public void createDatabaseWithThroughput() throws ClassNotFoundException { - final String dbName = TestConstants.DB_NAME + "-other"; - deleteDatabaseIfExists(dbName); + final String configuredThroughputDbName = TestConstants.DB_NAME + "-other"; + deleteDatabaseIfExists(configuredThroughputDbName); Integer expectedRequestUnits = 700; final CosmosConfig config = CosmosConfig.builder() .enableDatabaseThroughput(false, expectedRequestUnits) .build(); - cosmosTemplate = createReactiveCosmosTemplate(config, dbName); + final ReactiveCosmosTemplate configuredThroughputCosmosTemplate = createReactiveCosmosTemplate(config, configuredThroughputDbName); final CosmosEntityInformation personInfo = new CosmosEntityInformation<>(Person.class); - cosmosTemplate.createContainerIfNotExists(personInfo).block(); + configuredThroughputCosmosTemplate.createContainerIfNotExists(personInfo).block(); - final CosmosAsyncDatabase database = client.getDatabase(dbName); + final CosmosAsyncDatabase database = client.getDatabase(configuredThroughputDbName); final ThroughputResponse response = database.readThroughput().block(); assertEquals(expectedRequestUnits, response.getProperties().getManualThroughput()); }