Skip to content

Commit a7a4df7

Browse files
artembilangaryrussell
authored andcommitted
Add nohttp Gradle plugin (#1116)
* Add `nohttp` Gradle plugin * * Upgrade to Kafka Client 2.2.1 * Fix test do not provide a `null` for headers into the `ConsumerRecord`: it is not allowed any more in a new client version * Upgrade some other dependencies including Checkstyle plugin
1 parent b582291 commit a7a4df7

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

build.gradle

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
buildscript {
2-
ext.kotlinVersion = '1.3.21'
2+
ext.kotlinVersion = '1.3.31'
33
repositories {
44
maven { url 'https://repo.spring.io/plugins-release' }
55
}
66
dependencies {
7-
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16'
7+
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.18'
88
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
99
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion"
10+
classpath 'io.spring.nohttp:nohttp-gradle:0.0.2.RELEASE'
1011
}
1112
}
1213

1314
plugins {
1415
id 'base'
1516
id 'project-report'
1617
id 'idea'
17-
id "org.sonarqube" version '2.7'
18-
id 'org.asciidoctor.convert' version '1.5.10'
18+
id "org.sonarqube" version '2.7.1'
19+
id 'org.asciidoctor.convert' version '1.6.1'
1920
id 'org.ajoberstar.grgit' version '3.1.1'
2021
}
2122

23+
apply plugin: 'io.spring.nohttp'
24+
2225
description = 'Spring Kafka'
2326

2427
ext {
@@ -34,6 +37,11 @@ ext {
3437
files(grgit.status().unstaged.modified).filter{ f -> f.name.endsWith('.java') || f.name.endsWith('.kt') }
3538
}
3639

40+
nohttp {
41+
source.include '**/src/**'
42+
source.exclude '**/*.gif', '**/*.ks'
43+
}
44+
3745
allprojects {
3846
group = 'org.springframework.kafka'
3947

@@ -78,15 +86,15 @@ subprojects { subproject ->
7886
junit4Version = '4.12'
7987
junitJupiterVersion = '5.4.2'
8088
junitPlatformVersion = '1.4.2'
81-
kafkaVersion = '2.2.0'
89+
kafkaVersion = '2.2.1'
8290
log4jVersion = '2.11.2'
83-
mockitoVersion = '2.26.0'
91+
mockitoVersion = '2.28.2'
8492
scalaVersion = '2.12'
8593
springRetryVersion = '1.2.4.RELEASE'
8694
springVersion = '5.2.0.M2'
8795
springDataCommonsVersion = '2.2.0.M4'
88-
reactorVersion = '3.2.8.RELEASE'
89-
reactorKafkaVersion = '1.1.0.RELEASE'
96+
reactorVersion = '3.3.0.M1'
97+
reactorKafkaVersion = '1.2.0.BUILD-SNAPSHOT'
9098

9199
idPrefix = 'kafka'
92100

@@ -133,7 +141,7 @@ subprojects { subproject ->
133141

134142
checkstyle {
135143
configFile = file("${rootDir}/src/checkstyle/checkstyle.xml")
136-
toolVersion = "8.19"
144+
toolVersion = "8.21"
137145
}
138146

139147
jacocoTestReport {

spring-kafka/src/test/java/org/springframework/kafka/support/converter/BatchMessageConverterTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343

4444
/**
4545
* @author Biju Kunjummen
46+
* @author Artem Bilan
47+
*
4648
* @since 1.3
4749
*/
4850
public class BatchMessageConverterTests {
@@ -120,9 +122,7 @@ private MessageHeaders testGuts(BatchMessageConverter batchMessageConverter) {
120122
@Test
121123
public void missingHeaders() {
122124
BatchMessageConverter converter = new BatchMessagingMessageConverter();
123-
Headers nullHeaders = null;
124-
ConsumerRecord<String, String> record = new ConsumerRecord<>("foo", 1, 42, -1L, null, 0L, 0, 0, "bar", "baz",
125-
nullHeaders);
125+
ConsumerRecord<String, String> record = new ConsumerRecord<>("foo", 1, 42, -1L, null, 0L, 0, 0, "bar", "baz");
126126
List<ConsumerRecord<?, ?>> records = Collections.singletonList(record);
127127
Message<?> message = converter.toMessage(records, null, null, null);
128128
assertThat(((List<String>) message.getPayload())).contains("baz");

spring-kafka/src/test/java/org/springframework/kafka/support/converter/MessagingMessageConverterTests.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@
1919
import static org.assertj.core.api.Assertions.assertThat;
2020

2121
import org.apache.kafka.clients.consumer.ConsumerRecord;
22-
import org.apache.kafka.common.header.Headers;
2322
import org.junit.jupiter.api.Test;
2423

2524
import org.springframework.kafka.support.KafkaHeaders;
2625
import org.springframework.messaging.Message;
2726

2827
/**
2928
* @author Gary Russell
29+
* @author Artem Bilan
30+
*
3031
* @since 2.1.13
3132
*
3233
*/
@@ -35,9 +36,7 @@ public class MessagingMessageConverterTests {
3536
@Test
3637
void missingHeaders() {
3738
MessagingMessageConverter converter = new MessagingMessageConverter();
38-
Headers nullHeaders = null;
39-
ConsumerRecord<String, String> record = new ConsumerRecord<>("foo", 1, 42, -1L, null, 0L, 0, 0, "bar", "baz",
40-
nullHeaders);
39+
ConsumerRecord<String, String> record = new ConsumerRecord<>("foo", 1, 42, -1L, null, 0L, 0, 0, "bar", "baz");
4140
Message<?> message = converter.toMessage(record, null, null, null);
4241
assertThat(message.getPayload()).isEqualTo("baz");
4342
assertThat(message.getHeaders().get(KafkaHeaders.RECEIVED_TOPIC)).isEqualTo("foo");

0 commit comments

Comments
 (0)