Skip to content

Commit

Permalink
remove depdencies on org.springframework.cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
Rwolfe-Nava committed Jan 31, 2024
1 parent e3e26d0 commit 5b9f2f9
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 16 deletions.
12 changes: 10 additions & 2 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,23 @@
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<groupId>io.awspring.cloud</groupId>
<artifactId>spring-cloud-aws-autoconfigure</artifactId>
<version>${spring-cloud-aws.version}</version>
</dependency>

<dependency>
<groupId>io.awspring.cloud</groupId>
<artifactId>spring-cloud-starter-aws-messaging</artifactId>
<version>2.2.6.RELEASE</version>
<version>${spring-cloud-aws.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<version>3.1.5</version>
</dependency>

<dependency>
<groupId>gov.cms.ab2d</groupId>
<artifactId>ab2d-contracts-client</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
package gov.cms.ab2d.common.util;

import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
import com.amazonaws.services.sqs.AmazonSQSAsync;
import gov.cms.ab2d.eventclient.clients.SQSEventClient;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.cloud.aws.autoconfigure.context.ContextStackAutoConfiguration;
import org.springframework.cloud.aws.autoconfigure.messaging.MessagingAutoConfiguration;
import org.springframework.cloud.aws.messaging.config.SimpleMessageListenerContainerFactory;
import org.springframework.cloud.aws.messaging.listener.QueueMessageHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import io.awspring.cloud.messaging.config.SimpleMessageListenerContainerFactory;
import io.awspring.cloud.messaging.listener.QueueMessageHandler;

import static org.mockito.Mockito.mock;

@TestConfiguration
@EnableAutoConfiguration(exclude = {MessagingAutoConfiguration.class, ContextStackAutoConfiguration.class})
public class AB2DSQSMockConfig {

static {
Expand All @@ -42,7 +40,14 @@ public QueueMessageHandler messageHandler() {
}

@Bean("mockAmazonSQS")
@Primary
public AmazonSQSAsync amazonSQSAsync() {
return mock(AmazonSQSAsync.class);
}

@Bean
@Primary
public AWSCredentialsProvider awsCredentialsProvider() {
return new DefaultAWSCredentialsProviderChain();
}
}
44 changes: 37 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,36 @@
<testcontainers.version>1.18.3</testcontainers.version>
<newrelic.version>8.4.0</newrelic.version>
<postgres.version>42.6.0</postgres.version>
<!-- <spring-cloud.version>2021.0.8</spring-cloud.version> -->
<spring-cloud-aws.version>2.4.4</spring-cloud-aws.version>

<!-- Maven plugin versions -->
<jacoco.version>0.8.10</jacoco.version>
<maven.resources.plugin.version>3.3.1</maven.resources.plugin.version>
<maven.assembly.plugin.version>2.3</maven.assembly.plugin.version>

<!-- AB2D lib versions -->
<events-client.version>1.11.8</events-client.version>
<bfd-lib.version>2.0.16</bfd-lib.version>
<fhir-lib.version>1.1.11</fhir-lib.version>
<aggregator-lib.version>1.2.12</aggregator-lib.version>
<filters-lib.version>1.8.7</filters-lib.version>
<properties-client.version>1.1.9</properties-client.version>
<contract-client.version>1.1.4</contract-client.version>
<events-client.version>1.12.0</events-client.version>
<bfd-lib.version>2.1.0</bfd-lib.version>
<fhir-lib.version>1.2.0</fhir-lib.version>
<aggregator-lib.version>1.3.0</aggregator-lib.version>
<filters-lib.version>1.9.0</filters-lib.version>
<properties-client.version>1.2.0</properties-client.version>
<contract-client.version>1.2.0</contract-client.version>
</properties>

<!-- <dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement> -->

<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
Expand Down Expand Up @@ -82,6 +96,22 @@
<version>1.18.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.awspring.cloud</groupId>
<artifactId>spring-cloud-aws-dependencies</artifactId>
<version>${spring-cloud-aws.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.awspring.cloud</groupId>
<artifactId>spring-cloud-aws-autoconfigure</artifactId>
<version>${spring-cloud-aws.version}</version>
</dependency>
<dependency>
<groupId>io.awspring.cloud</groupId>
<artifactId>spring-cloud-starter-aws-messaging</artifactId>
<version>${spring-cloud-aws.version}</version>
</dependency>
</dependencies>

<build>
Expand Down

0 comments on commit 5b9f2f9

Please sign in to comment.