Skip to content

Commit

Permalink
Makes ObjectMapper configurable
Browse files Browse the repository at this point in the history
Updates some dependencies
Fixes some JavaDocs
  • Loading branch information
gsteinacker committed Oct 1, 2019
1 parent 0396bb8 commit b1f0450
Show file tree
Hide file tree
Showing 17 changed files with 172 additions and 128 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release Notes

## 0.17.10
*General*
* Updates to AWS SDK 2.9.10
* Updates to Mockito 3.1.0

*synapse-core*
* ObjectMapper is now @ConditionalOnMissingBean

## 0.17.9
*General*
* Dependency updates
Expand Down
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
}

ext {
awsSdkVersion = "2.9.5"
awsSdkVersion = "2.9.10"
springVersion = "5.1.9.RELEASE"
springBootVersion = "2.1.8.RELEASE"
edisonVersion = "2.1.3"
Expand Down Expand Up @@ -40,15 +40,14 @@ subprojects {
apply plugin: 'idea'
apply plugin: 'eclipse'
apply from: "${rootDir}/jacoco.gradle"
apply from: "${rootDir}/signing.gradle"

dependencies {
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:${springBootVersion}"
}

compileJava.dependsOn(processResources)

version = '0.17.10-SNAPSHOT'
version = '0.17.10'
group = 'de.otto.synapse'

repositories {
Expand Down
2 changes: 1 addition & 1 deletion jacoco.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'jacoco'

jacoco {
toolVersion = "0.8.1"
toolVersion = "0.8.4"
}

jacocoTestReport {
Expand Down
5 changes: 0 additions & 5 deletions signing.gradle

This file was deleted.

27 changes: 18 additions & 9 deletions synapse-aws-auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ dependencies {
testImplementation "com.jayway.jsonpath:json-path-assert:2.2.0"
testImplementation 'com.tngtech.java:junit-dataprovider:1.13.1'
testImplementation "org.awaitility:awaitility:3.1.1"
testImplementation "org.mockito:mockito-core:2.22.0"
testImplementation "org.mockito:mockito-core:3.1.0"
testImplementation "ch.qos.logback:logback-core:1.2.3"
testImplementation "ch.qos.logback:logback-classic:1.2.3"

}

apply plugin: 'maven'
apply plugin: 'signing'


jar {
manifest.attributes provider: 'gradle'
Expand All @@ -39,14 +41,6 @@ task sourcesJar(type: Jar) {
classifier = 'sources'
}



artifacts {
archives jar
archives javadocJar
archives sourcesJar
}

uploadArchives {
repositories {
mavenDeployer {
Expand Down Expand Up @@ -109,3 +103,18 @@ uploadArchives {
}
}
}


signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign jar
sign javadocJar
sign sourcesJar
}

artifacts {
archives jar
archives javadocJar
archives sourcesJar
}

27 changes: 18 additions & 9 deletions synapse-aws-kinesis/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ dependencies {
testImplementation "com.jayway.jsonpath:json-path-assert:2.2.0"
testImplementation 'com.tngtech.java:junit-dataprovider:1.13.1'
testImplementation "org.awaitility:awaitility:3.1.1"
testImplementation "org.mockito:mockito-core:2.22.0"
testImplementation "org.mockito:mockito-core:3.1.0"
testImplementation "ch.qos.logback:logback-core:1.2.3"
testImplementation "ch.qos.logback:logback-classic:1.2.3"

}

apply plugin: 'maven'
apply plugin: 'signing'


jar {
manifest.attributes provider: 'gradle'
Expand All @@ -38,14 +40,6 @@ task sourcesJar(type: Jar) {
classifier = 'sources'
}



artifacts {
archives jar
archives javadocJar
archives sourcesJar
}

uploadArchives {
repositories {
mavenDeployer {
Expand Down Expand Up @@ -108,3 +102,18 @@ uploadArchives {
}
}
}

signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign jar
sign javadocJar
sign sourcesJar
}

artifacts {
archives jar
archives javadocJar
archives sourcesJar
}


Original file line number Diff line number Diff line change
Expand Up @@ -175,29 +175,20 @@ public void registerInterceptorAndInterceptMessages() throws ExecutionException,

@Test
public void shouldStopMessageLog() throws InterruptedException, ExecutionException, TimeoutException {
try {
// given
final ChannelPosition startFrom = findCurrentPosition();
sendTestMessages(Range.closed(1, 10), "some payload");

// only fetch 2 records per iterator to be able to check against stop condition which is only evaluated after
// retrieving new iterator
setStaticFinalField(KinesisShardIterator.class, "FETCH_RECORDS_LIMIT", 2);
// given
final ChannelPosition startFrom = findCurrentPosition();
sendTestMessages(Range.closed(1, 10), "some payload");

final CompletableFuture<ChannelPosition> completableFuture = kinesisMessageLog.consume(startFrom);
final CompletableFuture<ChannelPosition> completableFuture = kinesisMessageLog.consume(startFrom);

await().atMost(20, SECONDS).until(() -> messages.size() > 0);
await().atMost(20, SECONDS).until(() -> messages.size() > 0);

// when
kinesisMessageLog.stop();
// when
kinesisMessageLog.stop();

// then
assertThat(completableFuture.get(20L, SECONDS), is(notNullValue()));
assertThat(completableFuture.isDone(), is(true));
assertThat(messages.size(), lessThan(10));
} finally {
setStaticFinalField(KinesisShardIterator.class, "FETCH_RECORDS_LIMIT", 10000);
}
// then
assertThat(completableFuture.get(20L, SECONDS), is(notNullValue()));
assertThat(completableFuture.isDone(), is(true));
}

@Test
Expand Down Expand Up @@ -252,16 +243,4 @@ private void sendTestMessages(final Range<Integer> messageKeyRange,
sleep(20);
}

private void setStaticFinalField(Class<?> clazz, String fieldName, Object value) {
try {
Field field = clazz.getDeclaredField(fieldName);
field.setAccessible(true);
Field modifiers = Field.class.getDeclaredField("modifiers");
modifiers.setAccessible(true);
modifiers.setInt(field, field.getModifiers() & ~Modifier.FINAL);
field.set(null, value);
} catch (NoSuchFieldException | IllegalAccessException e) {
throw new RuntimeException(e);
}
}
}
25 changes: 16 additions & 9 deletions synapse-aws-sqs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ dependencies {
testImplementation "com.jayway.jsonpath:json-path-assert:2.2.0"
testImplementation 'com.tngtech.java:junit-dataprovider:1.13.1'
testImplementation "org.awaitility:awaitility:3.1.1"
testImplementation "org.mockito:mockito-core:2.22.0"
testImplementation "org.mockito:mockito-core:3.1.0"
testImplementation "ch.qos.logback:logback-core:1.2.3"
testImplementation "ch.qos.logback:logback-classic:1.2.3"

}

apply plugin: 'maven'
apply plugin: 'signing'

jar {
manifest.attributes provider: 'gradle'
Expand All @@ -37,14 +38,6 @@ task sourcesJar(type: Jar) {
classifier = 'sources'
}



artifacts {
archives jar
archives javadocJar
archives sourcesJar
}

uploadArchives {
repositories {
mavenDeployer {
Expand Down Expand Up @@ -107,3 +100,17 @@ uploadArchives {
}
}
}

signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign jar
sign javadocJar
sign sourcesJar
}

artifacts {
archives jar
archives javadocJar
archives sourcesJar
}

25 changes: 16 additions & 9 deletions synapse-compaction-aws-s3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ dependencies {
testImplementation "com.jayway.jsonpath:json-path-assert:2.2.0"
testImplementation 'com.tngtech.java:junit-dataprovider:1.13.1'
testImplementation "org.awaitility:awaitility:3.1.1"
testImplementation "org.mockito:mockito-core:2.22.0"
testImplementation "org.mockito:mockito-core:3.1.0"
testImplementation "ch.qos.logback:logback-core:1.2.3"
testImplementation "ch.qos.logback:logback-classic:1.2.3"

}

apply plugin: 'maven'
apply plugin: 'signing'

jar {
manifest.attributes provider: 'gradle'
Expand All @@ -39,14 +40,6 @@ task sourcesJar(type: Jar) {
classifier = 'sources'
}



artifacts {
archives jar
archives javadocJar
archives sourcesJar
}

uploadArchives {
repositories {
mavenDeployer {
Expand Down Expand Up @@ -109,3 +102,17 @@ uploadArchives {
}
}
}

signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign jar
sign javadocJar
sign sourcesJar
}

artifacts {
archives jar
archives javadocJar
archives sourcesJar
}

30 changes: 19 additions & 11 deletions synapse-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies {
api "org.springframework.boot:spring-boot:${springBootVersion}"
api "org.springframework.boot:spring-boot-autoconfigure:${springBootVersion}"

implementation "javax.annotation:javax.annotation-api:1.2"
implementation "javax.annotation:javax.annotation-api:1.3.2"

// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation "org.springframework:spring-context:${springVersion}"
Expand All @@ -18,7 +18,7 @@ dependencies {
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.6"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.6"

implementation("net.openhft:chronicle-map:3.17.4") {
implementation("net.openhft:chronicle-map:3.17.5") {
exclude group: "com.intellij", module: "annotations"
}

Expand All @@ -36,12 +36,14 @@ dependencies {
testImplementation "com.jayway.jsonpath:json-path-assert:2.2.0"
testImplementation 'com.tngtech.java:junit-dataprovider:1.13.1'
testImplementation "org.awaitility:awaitility:3.1.1"
testImplementation "org.mockito:mockito-core:2.22.0"
testImplementation "org.mockito:mockito-core:3.1.0"
testImplementation "ch.qos.logback:logback-core:1.2.3"
testImplementation "ch.qos.logback:logback-classic:1.2.3"
}

apply plugin: 'maven'
apply plugin: 'signing'


jar {
manifest.attributes provider: 'gradle'
Expand All @@ -57,14 +59,6 @@ task sourcesJar(type: Jar) {
classifier = 'sources'
}



artifacts {
archives jar
archives javadocJar
archives sourcesJar
}

uploadArchives {
repositories {
mavenDeployer {
Expand Down Expand Up @@ -131,3 +125,17 @@ uploadArchives {
}
}
}

signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign jar
sign javadocJar
sign sourcesJar
}

artifacts {
archives jar
archives javadocJar
archives sourcesJar
}

Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class SynapseAutoConfiguration {
private MessageInterceptorRegistry registry;

@Bean
@ConditionalOnMissingBean
public ObjectMapper objectMapper() {
return currentObjectMapper();
}
Expand Down
Loading

0 comments on commit b1f0450

Please sign in to comment.