Skip to content

Commit

Permalink
Bump mockito-core from 3.9.0 to 3.10.0 (#542)
Browse files Browse the repository at this point in the history
* Bump mockito-core from 3.9.0 to 3.10.0

Bumps [mockito-core](https://github.com/mockito/mockito) from 3.9.0 to 3.10.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v3.9.0...v3.10.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Convert all tests to use test containers

- rename spring.content.azure.storage.bucket to match documentation
- use a system property to set the bucket rather than overriding the placement service (that breaks some tests)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Paul Warren <paul_c_warren@yahoo.com>
  • Loading branch information
dependabot[bot] and paulcwarren authored May 17, 2021
1 parent 7f21567 commit f69c9d4
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 35 deletions.
2 changes: 1 addition & 1 deletion spring-content-azure-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.9.0</version>
<version>3.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class AzureStorageConfiguration {
@Autowired(required = false)
private List<AzureStorageConfigurer> configurers;

@Value("${spring.content.gcp.storage.bucket:#{environment.AZURE_STORAGE_BUCKET}}")
@Value("${spring.content.azure.bucket:#{environment.AZURE_STORAGE_BUCKET}}")
private String bucket;

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.content.azure.config.AzureStorageConfigurer;
import org.springframework.content.azure.config.BlobId;
import org.springframework.content.azure.config.EnableAzureStorage;
Expand All @@ -30,14 +29,28 @@
import org.springframework.context.annotation.Import;
import org.springframework.core.convert.converter.ConverterRegistry;

import com.azure.storage.blob.BlobContainerClient;
import com.azure.storage.blob.BlobServiceClientBuilder;
import com.github.paulcwarren.ginkgo4j.Ginkgo4jRunner;

import internal.org.springframework.content.azure.it.Azurite;
import lombok.Data;

@RunWith(Ginkgo4jRunner.class)
public class EnableAzureStorageTest {

private static BlobServiceClientBuilder builder = Azurite.getBlobServiceClientBuilder();
private static BlobContainerClient client = null;

static {
client = builder.buildClient().getBlobContainerClient("test");
if (!client.exists()) {
client.create();
}

System.setProperty("spring.content.azure.bucket", "azure-test-bucket");
}

private AnnotationConfigApplicationContext context;

// mocks
Expand Down Expand Up @@ -159,17 +172,14 @@ public interface TestEntityStore extends AssociativeStore<TestEntity, BlobId> {
@Configuration
public static class InfrastructureConfig {

@Value("#{environment.AZURE_STORAGE_ENDPOINT}")
private String endpoint;

@Value("#{environment.AZURE_STORAGE_CONNECTION_STRING}")
private String connString;
@Bean
public BlobServiceClientBuilder builder() {
return builder;
}

@Bean
public BlobServiceClientBuilder storage() {
return new BlobServiceClientBuilder()
.endpoint(endpoint)
.connectionString(connString);
public BlobContainerClient blobContainerClient() {
return client;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import javax.persistence.Id;
import javax.sql.DataSource;

import com.azure.storage.blob.BlobContainerClient;
import internal.org.springframework.content.azure.config.BlobIdResolverConverter;
import org.apache.commons.io.IOUtils;
import org.hamcrest.Matchers;
import org.junit.Test;
Expand All @@ -36,13 +34,10 @@
import org.springframework.content.commons.annotations.ContentLength;
import org.springframework.content.commons.io.DeletableResource;
import org.springframework.content.commons.repository.ContentStore;
import org.springframework.content.commons.utils.PlacementService;
import org.springframework.content.commons.utils.PlacementServiceImpl;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Primary;
import org.springframework.core.io.Resource;
import org.springframework.core.io.WritableResource;
import org.springframework.data.jpa.repository.JpaRepository;
Expand All @@ -56,6 +51,7 @@
import org.springframework.transaction.PlatformTransactionManager;

import com.azure.core.http.rest.PagedIterable;
import com.azure.storage.blob.BlobContainerClient;
import com.azure.storage.blob.BlobServiceClientBuilder;
import com.azure.storage.blob.models.BlobItem;
import com.github.paulcwarren.ginkgo4j.Ginkgo4jConfiguration;
Expand All @@ -70,6 +66,10 @@
@Ginkgo4jConfiguration(threads=1)
public class AzureStorageIT {

static {
System.setProperty("spring.content.azure.bucket", "azure-test-bucket");
}

private TestEntity entity;
private Resource genericResource;

Expand Down Expand Up @@ -374,15 +374,6 @@ public BlobContainerClient blobContainerClient(BlobServiceClientBuilder builder)
}
return client;
}

@Bean
@Primary
public PlacementService azureStoragePlacementService() {
// Provide default for tests to cover for missing env.AZURE_STORAGE_BUCKET
PlacementService conversion = new PlacementServiceImpl();
conversion.addConverter(new BlobIdResolverConverter("azure-test-bucket"));
return conversion;
}
}

@Configuration
Expand Down
2 changes: 1 addition & 1 deletion spring-content-cmis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.9.0</version>
<version>3.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion spring-content-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.9.0</version>
<version>3.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion spring-content-fs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.9.0</version>
<version>3.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion spring-content-gcs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.9.0</version>
<version>3.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion spring-content-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.9.0</version>
<version>3.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion spring-content-mongo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.9.0</version>
<version>3.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion spring-content-renditions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.9.0</version>
<version>3.10.0</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion spring-content-s3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.9.0</version>
<version>3.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion spring-content-solr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.9.0</version>
<version>3.10.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down

0 comments on commit f69c9d4

Please sign in to comment.