Skip to content

Commit

Permalink
azure
Browse files Browse the repository at this point in the history
  • Loading branch information
Croway committed Nov 28, 2024
1 parent ea8b20e commit 677fa78
Show file tree
Hide file tree
Showing 26 changed files with 87 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.camel.CamelContext;
import org.apache.camel.component.azure.storage.blob.BlobConfiguration;
import org.apache.camel.test.infra.azure.common.AzureConfigs;
import org.apache.camel.test.infra.azure.common.services.AzureService;
import org.apache.camel.test.infra.azure.common.services.AzureTestService;
import org.apache.camel.test.infra.azure.storage.blob.clients.AzureStorageBlobClientUtils;
import org.apache.camel.test.infra.azure.storage.blob.services.AzureStorageBlobServiceFactory;
import org.apache.camel.test.junit5.CamelTestSupport;
Expand All @@ -36,7 +36,7 @@
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class Base extends CamelTestSupport {
@RegisterExtension
public static AzureService service;
public static AzureTestService service;

protected BlobServiceClient serviceClient;
protected String containerName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.apache.camel.CamelContext;
import org.apache.camel.component.azure.storage.datalake.DataLakeConfiguration;
import org.apache.camel.test.infra.azure.common.AzureConfigs;
import org.apache.camel.test.infra.azure.common.services.AzureService;
import org.apache.camel.test.infra.azure.common.services.AzureTestService;
import org.apache.camel.test.infra.azure.storage.datalake.clients.AzureStorageDataLakeClientUtils;
import org.apache.camel.test.infra.azure.storage.datalake.services.AzureStorageDataLakeServiceFactory;
import org.apache.camel.test.junit5.CamelTestSupport;
Expand All @@ -42,7 +42,7 @@
public class Base extends CamelTestSupport {

@RegisterExtension
public AzureService service = AzureStorageDataLakeServiceFactory.createService();
public static AzureTestService service = AzureStorageDataLakeServiceFactory.createService();

protected DataLakeServiceClient serviceClient;
protected DataLakeConfiguration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.camel.CamelContext;
import org.apache.camel.component.azure.storage.queue.QueueConfiguration;
import org.apache.camel.test.infra.azure.common.AzureConfigs;
import org.apache.camel.test.infra.azure.common.services.AzureService;
import org.apache.camel.test.infra.azure.common.services.AzureTestService;
import org.apache.camel.test.infra.azure.storage.queue.clients.AzureStorageClientUtils;
import org.apache.camel.test.infra.azure.storage.queue.services.AzureStorageQueueServiceFactory;
import org.apache.camel.test.junit5.CamelTestSupport;
Expand All @@ -34,7 +34,7 @@
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class StorageQueueBase extends CamelTestSupport {
@RegisterExtension
public static AzureService service;
public static AzureTestService service;

protected QueueServiceClient serviceClient;
protected String queueName;
Expand Down
10 changes: 10 additions & 0 deletions test-infra/camel-test-infra-azure-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@
<version>${project.version}</version>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-infra-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>${testcontainers-version}</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
package org.apache.camel.test.infra.azure.common.services;

import org.apache.camel.test.infra.azure.common.AzureCredentialsHolder;
import org.apache.camel.test.infra.common.services.TestService;
import org.apache.camel.test.infra.common.services.InfrastructureService;

public interface AzureService extends TestService {
public interface AzureService extends InfrastructureService {

/**
* Gets the credentials for the test service
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.test.infra.azure.common.services;

import org.apache.camel.test.infra.common.services.ContainerTestService;
import org.apache.camel.test.infra.common.services.TestService;

public interface AzureTestService extends AzureService, TestService, ContainerTestService {
}
5 changes: 5 additions & 0 deletions test-infra/camel-test-infra-azure-storage-blob/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
<version>${project.version}</version>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-infra-azure-common</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,29 @@

package org.apache.camel.test.infra.azure.storage.blob.services;

import org.apache.camel.test.infra.azure.common.services.AzureService;
import org.apache.camel.test.infra.azure.common.services.AzureTestService;
import org.apache.camel.test.infra.common.services.SimpleTestServiceBuilder;

public final class AzureStorageBlobServiceFactory {
private AzureStorageBlobServiceFactory() {

}

public static SimpleTestServiceBuilder<AzureService> builder() {
public static SimpleTestServiceBuilder<AzureTestService> builder() {
return new SimpleTestServiceBuilder<>("azure");
}

public static AzureService createService() {
public static AzureTestService createService() {
return builder()
.addLocalMapping(AzureStorageBlobLocalContainerService::new)
.addRemoteMapping(AzureStorageBlobRemoteService::new)
.addLocalMapping(AzureStorageBlobLocalContainerTestService::new)
.addRemoteMapping(AzureStorageBlobRemoteTestService::new)
.build();
}

static class AzureStorageBlobLocalContainerTestService extends AzureStorageBlobLocalContainerService
implements AzureTestService {
}

static class AzureStorageBlobRemoteTestService extends AzureStorageBlobRemoteService implements AzureTestService {
}
}
5 changes: 5 additions & 0 deletions test-infra/camel-test-infra-azure-storage-datalake/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
<version>${project.version}</version>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-infra-azure-common</artifactId>
<version>${project.version}</version>
</dependency>

<!-- azure sdk -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.camel.test.infra.azure.storage.datalake.services;

import org.apache.camel.test.infra.azure.common.services.AzureService;
import org.apache.camel.test.infra.azure.common.services.AzureTestService;
import org.apache.camel.test.infra.common.services.SimpleTestServiceBuilder;

public final class AzureStorageDataLakeServiceFactory {
Expand All @@ -26,13 +26,16 @@ private AzureStorageDataLakeServiceFactory() {

}

public static SimpleTestServiceBuilder<AzureService> builder() {
public static SimpleTestServiceBuilder<AzureTestService> builder() {
return new SimpleTestServiceBuilder<>("azure");
}

public static AzureService createService() {
public static AzureTestService createService() {
return builder()
.addRemoteMapping(AzureStorageDataLakeRemoteService::new)
.addRemoteMapping(AzureStorageDataLakeRemoteTestService::new)
.build();
}

static class AzureStorageDataLakeRemoteTestService extends AzureStorageDataLakeRemoteService implements AzureTestService {
}
}
5 changes: 5 additions & 0 deletions test-infra/camel-test-infra-azure-storage-queue/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
<version>${project.version}</version>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-infra-azure-common</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,29 @@

package org.apache.camel.test.infra.azure.storage.queue.services;

import org.apache.camel.test.infra.azure.common.services.AzureService;
import org.apache.camel.test.infra.azure.common.services.AzureTestService;
import org.apache.camel.test.infra.common.services.SimpleTestServiceBuilder;

public final class AzureStorageQueueServiceFactory {
private AzureStorageQueueServiceFactory() {

}

public static SimpleTestServiceBuilder<AzureService> builder() {
public static SimpleTestServiceBuilder<AzureTestService> builder() {
return new SimpleTestServiceBuilder<>("azure");
}

public static AzureService createService() {
public static AzureTestService createService() {
return builder()
.addLocalMapping(AzureStorageQueueLocalContainerService::new)
.addRemoteMapping(AzureStorageQueueRemoteService::new)
.addLocalMapping(AzureStorageQueueLocalContainerTestService::new)
.addRemoteMapping(AzureStorageQueueRemoteTestService::new)
.build();
}

public static class AzureStorageQueueLocalContainerTestService extends AzureStorageQueueLocalContainerService
implements AzureTestService {
}

public static class AzureStorageQueueRemoteTestService extends AzureStorageQueueRemoteService implements AzureTestService {
}
}

0 comments on commit 677fa78

Please sign in to comment.