Skip to content

Commit

Permalink
#2: Upgrade Eventuate CDC dependencies. Refactored profile resolvers.…
Browse files Browse the repository at this point in the history
… Removed redundant spring version definitions.
  • Loading branch information
dartartem committed Dec 17, 2021
1 parent 7a2ae2d commit c4a9ab1
Show file tree
Hide file tree
Showing 22 changed files with 45 additions and 60 deletions.
2 changes: 1 addition & 1 deletion eventuate-cdc-common-e2e-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies {
api "io.eventuate.common:eventuate-common-spring-jdbc:$eventuateCommonVersion"
api "junit:junit:4.11"
api "io.eventuate.util:eventuate-util-test:$eventuateUtilVersion"
api "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
api "org.springframework.boot:spring-boot-starter-test"
}

test {
Expand Down
2 changes: 1 addition & 1 deletion eventuate-cdc-data-producer-wrappers/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies {

testImplementation project(":eventuate-local-java-cdc-connector-test-util")
testImplementation "junit:junit:4.11"
testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testImplementation "org.springframework.boot:spring-boot-starter-test"
}

test {
Expand Down
6 changes: 3 additions & 3 deletions eventuate-cdc-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootPluginVersion")
}
}

apply plugin: 'org.springframework.boot'

dependencies {
implementation "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion"
implementation "org.springframework.boot:spring-boot-starter-web:$springBootVersion"
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "org.springframework.boot:spring-boot-starter-web"
implementation project(":eventuate-cdc-connector-autoconfigure")

implementation 'io.micrometer:micrometer-registry-jmx:0.12.0.RELEASE'
Expand Down
8 changes: 4 additions & 4 deletions eventuate-local-java-cdc-connector-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ apply plugin: 'java-library'
dependencies {
api project (":eventuate-cdc-data-producer-wrappers")

api "org.springframework.boot:spring-boot-starter-actuator:$springBootVersion"
api "org.springframework.boot:spring-boot-starter:$springBootVersion"
api "org.springframework.boot:spring-boot-starter-actuator"
api "org.springframework.boot:spring-boot-starter"
api 'org.apache.curator:curator-recipes:2.11.0'
api "io.dropwizard.metrics:metrics-core:$dropwizardMetricsVersion"
api "org.springframework.boot:spring-boot-starter-jdbc:$springBootVersion"
api "org.springframework.boot:spring-boot-starter-jdbc"
api 'io.micrometer:micrometer-core:1.1.1'
api 'io.micrometer:micrometer-registry-jmx:1.1.1'
api 'io.micrometer:micrometer-registry-prometheus:1.1.1'
Expand All @@ -25,7 +25,7 @@ dependencies {
api 'com.microsoft.sqlserver:mssql-jdbc:7.2.1.jre8'
api 'org.apache.kafka:kafka-clients:2.3.0'
testImplementation "junit:junit:4.11"
testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation "io.eventuate.util:eventuate-util-test:$eventuateUtilVersion"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies {
api "io.eventuate.messaging.kafka:eventuate-messaging-kafka-spring-common:$eventuateMessagingKafkaVersion"

testImplementation "junit:junit:4.11"
testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testImplementation "org.springframework.boot:spring-boot-starter-test"
}

test {
Expand Down
2 changes: 1 addition & 1 deletion eventuate-local-java-cdc-connector-e2e-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies {
testImplementation "io.eventuate.common:eventuate-common-spring-jdbc:$eventuateCommonVersion"
testImplementation "io.eventuate.common:eventuate-common-spring-id:$eventuateCommonVersion"
testImplementation "junit:junit:4.11"
testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testImplementation "org.springframework.boot:spring-boot-starter-test"
}

test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies {
testImplementation project(":eventuate-local-java-cdc-connector-db-log-test-common")
testImplementation "io.eventuate.util:eventuate-util-test:$eventuateUtilVersion"
testImplementation "junit:junit:4.11"
testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testImplementation "org.springframework.boot:spring-boot-starter-test"
}

test {
Expand Down
2 changes: 1 addition & 1 deletion eventuate-local-java-cdc-connector-polling/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {
testImplementation project(":eventuate-local-java-cdc-connector-test-util")
testImplementation "io.eventuate.util:eventuate-util-test:$eventuateUtilVersion"
testImplementation "junit:junit:4.11"
testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testImplementation "org.springframework.boot:spring-boot-starter-test"
}

test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {
testImplementation project(":eventuate-local-java-cdc-connector-db-log-test-common")
testImplementation "io.eventuate.util:eventuate-util-test:$eventuateUtilVersion"
testImplementation "junit:junit:4.11"
testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testImplementation "org.springframework.boot:spring-boot-starter-test"
}

test {
Expand Down
2 changes: 1 addition & 1 deletion eventuate-local-java-cdc-connector-unified/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies {

testImplementation "junit:junit:4.11"
testImplementation "com.h2database:h2:1.4.199"
testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testImplementation "org.springframework.boot:spring-boot-starter-test"
}

test {
Expand Down
6 changes: 3 additions & 3 deletions eventuate-local-java-jdbc/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'java-library'

dependencies {
api "org.springframework.boot:spring-boot-starter:$springBootVersion"
api "org.springframework.boot:spring-boot-starter-jdbc:$springBootVersion"
api "org.springframework.boot:spring-boot-starter"
api "org.springframework.boot:spring-boot-starter-jdbc"
api 'mysql:mysql-connector-java:8.0.21'
api ('org.postgresql:postgresql:42.1.4') {
exclude group: "org.slf4j", module: "slf4j-simple"
}
api group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '7.2.1.jre8'

testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testImplementation "org.springframework.boot:spring-boot-starter-test"

}
2 changes: 1 addition & 1 deletion eventuate-local-java-migration/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies {
testImplementation "io.eventuate.messaging.kafka:eventuate-messaging-kafka-spring-common:$eventuateMessagingKafkaVersion"
testImplementation "io.eventuate.util:eventuate-util-test:$eventuateUtilVersion"
testImplementation "junit:junit:4.11"
testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testImplementation "org.springframework.boot:spring-boot-starter-test"
}

test {
Expand Down
6 changes: 3 additions & 3 deletions eventuate-local-java-test-util/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'java-library'

dependencies {
api "org.springframework.boot:spring-boot-starter:$springBootVersion"
api "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
api "org.springframework.boot:spring-boot-starter-jdbc:$springBootVersion"
api "org.springframework.boot:spring-boot-starter"
api "org.springframework.boot:spring-boot-starter-test"
api "org.springframework.boot:spring-boot-starter-jdbc"
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
package io.eventuate.local.testutil;

import java.util.Set;

public class DefaultAndPollingProfilesResolver extends DefaultProfilesResolver {
@Override
public String[] resolve(Class<?> testClass) {
Set<String> activeProfiles = getDefaultProfiles();

activeProfiles.add("EventuatePolling");

return convertProfilesToArray(activeProfiles);
public DefaultAndPollingProfilesResolver() {
super("EventuatePolling");
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
package io.eventuate.local.testutil;

import java.util.Set;

public class DefaultAndPostgresProfilesResolver extends DefaultProfilesResolver {
@Override
public String[] resolve(Class<?> testClass) {
Set<String> activeProfiles = getDefaultProfiles();

activeProfiles.add("postgres");

return convertProfilesToArray(activeProfiles);
public DefaultAndPostgresProfilesResolver() {
super("postgres");
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
package io.eventuate.local.testutil;

import java.util.Set;

public class DefaultAndPostgresWalProfilesResolver extends DefaultProfilesResolver {
@Override
public String[] resolve(Class<?> testClass) {
Set<String> activeProfiles = getDefaultProfiles();

activeProfiles.add("PostgresWal");
activeProfiles.add("postgres");

return convertProfilesToArray(activeProfiles);
public DefaultAndPostgresWalProfilesResolver() {
super("PostgresWal", "postgres");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@

import org.springframework.test.context.ActiveProfilesResolver;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import static java.util.Arrays.asList;

public class DefaultProfilesResolver implements ActiveProfilesResolver {
private List<String> additionalProfiles;

public DefaultProfilesResolver(String... additionalProfiles) {
this.additionalProfiles = asList(additionalProfiles);
}

@Override
public String[] resolve(Class<?> testClass) {

Set<String> activeProfiles = getDefaultProfiles();

activeProfiles.add("postgres");
activeProfiles.add("PostgresWal");
activeProfiles.addAll(this.additionalProfiles);

return convertProfilesToArray(activeProfiles);
}
Expand All @@ -23,7 +29,7 @@ protected Set<String> getDefaultProfiles() {

if (springProfilesActive == null) return new HashSet<>();

return new HashSet<>(Arrays.asList(springProfilesActive.split(",")));
return new HashSet<>(asList(springProfilesActive.split(",")));
}

protected String[] convertProfilesToArray(Set<String> profiles) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies {
testImplementation "io.eventuate.messaging.activemq:eventuate-messaging-activemq-spring-consumer:$eventuateMessagingActiveMQVersion"
testImplementation "io.eventuate.util:eventuate-util-test:$eventuateUtilVersion"
testImplementation "junit:junit:4.11"
testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testImplementation "org.springframework.boot:spring-boot-starter-test"
}

test {
Expand Down
2 changes: 1 addition & 1 deletion eventuate-tram-cdc-connector-kafka-e2e-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies {
testImplementation "io.eventuate.messaging.kafka:eventuate-messaging-kafka-spring-consumer:$eventuateMessagingKafkaVersion"
testImplementation "io.eventuate.util:eventuate-util-test:$eventuateUtilVersion"
testImplementation "junit:junit:4.11"
testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testImplementation "org.springframework.boot:spring-boot-starter-test"
}

test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies {
testImplementation "io.eventuate.messaging.rabbitmq:eventuate-messaging-rabbitmq-spring-consumer:$eventuateMessagingRabbitMQVersion"
testImplementation "io.eventuate.util:eventuate-util-test:$eventuateUtilVersion"
testImplementation "junit:junit:4.11"
testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testImplementation "org.springframework.boot:spring-boot-starter-test"
}

test {
Expand Down
2 changes: 1 addition & 1 deletion eventuate-tram-cdc-connector-redis-e2e-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies {
testImplementation "io.eventuate.messaging.redis:eventuate-messaging-redis-spring-common:$eventuateMessagingRedisVersion"
testImplementation "io.eventuate.util:eventuate-util-test:$eventuateUtilVersion"
testImplementation "junit:junit:4.11"
testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testImplementation "org.springframework.boot:spring-boot-starter-test"
}

test {
Expand Down
4 changes: 2 additions & 2 deletions eventuate-tram-cdc-connector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies {
api "io.eventuate.messaging.kafka:eventuate-messaging-kafka-spring-common:$eventuateMessagingKafkaVersion"

api project(":eventuate-local-java-cdc-connector-unified:")
api "org.springframework.boot:spring-boot-starter-web:$springBootVersion"
api "org.springframework.boot:spring-boot-starter-web"

testImplementation "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testImplementation "org.springframework.boot:spring-boot-starter-test"
}

0 comments on commit c4a9ab1

Please sign in to comment.