Skip to content

Commit 2c15bf8

Browse files
acogoluegnesmichaelklishin
authored andcommitted
Refactor MQTT Java tests
Use AssertJ instead of JUnit assertions (more readable API). Bump dependencies and clean up pom.xml.
1 parent 2daed29 commit 2c15bf8

File tree

5 files changed

+314
-301
lines changed

5 files changed

+314
-301
lines changed

deps/rabbitmq_mqtt/test/java_SUITE_data/pom.xml

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,45 +12,63 @@
1212
<description>Fetches test dependencies only.</description>
1313
<url>https://www.rabbitmq.com</url>
1414

15+
<properties>
16+
<paho.v5.version>[1.2.5,)</paho.v5.version>
17+
<paho.v3.version>[1.2.5,)</paho.v3.version>
18+
<amqp-client.version>5.18.0</amqp-client.version>
19+
<junit.version>5.9.3</junit.version>
20+
<assertj.version>3.24.2</assertj.version>
21+
<maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
22+
<groovy-maven-plugin.version>2.1.1</groovy-maven-plugin.version>
23+
<groovy.version>2.4.21</groovy.version>
24+
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
25+
<spotless.version>2.37.0</spotless.version>
26+
<google-java-format.version>1.17.0</google-java-format.version>
27+
<test-keystore.ca>${project.build.directory}/ca.keystore</test-keystore.ca>
28+
<test-keystore.password>bunnychow</test-keystore.password>
29+
<groovy-scripts.dir>${basedir}/src/test/scripts</groovy-scripts.dir>
30+
</properties>
31+
1532
<dependencies>
1633
<dependency>
1734
<groupId>org.eclipse.paho</groupId>
1835
<artifactId>org.eclipse.paho.mqttv5.client</artifactId>
19-
<version>1.2.5</version>
36+
<version>${paho.v5.version}</version>
2037
<scope>test</scope>
2138
</dependency>
2239
<dependency>
2340
<groupId>org.eclipse.paho</groupId>
2441
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
25-
<version>[1.2.1,)</version>
42+
<version>${paho.v3.version}</version>
2643
<scope>test</scope>
2744
</dependency>
2845
<dependency>
2946
<groupId>com.rabbitmq</groupId>
3047
<artifactId>amqp-client</artifactId>
31-
<version>5.16.0</version>
48+
<version>${amqp-client.version}</version>
3249
<scope>test</scope>
3350
</dependency>
3451
<dependency>
3552
<groupId>org.junit.jupiter</groupId>
3653
<artifactId>junit-jupiter</artifactId>
37-
<version>5.9.2</version>
54+
<version>${junit.version}</version>
55+
<scope>test</scope>
56+
</dependency>
57+
<dependency>
58+
<groupId>org.assertj</groupId>
59+
<artifactId>assertj-core</artifactId>
60+
<version>${assertj.version}</version>
3861
<scope>test</scope>
3962
</dependency>
40-
</dependencies>
4163

42-
<properties>
43-
<test-keystore.ca>${project.build.directory}/ca.keystore</test-keystore.ca>
44-
<test-keystore.password>bunnychow</test-keystore.password>
45-
<groovy-scripts.dir>${basedir}/src/test/scripts</groovy-scripts.dir>
46-
</properties>
64+
</dependencies>
4765

4866
<build>
4967
<plugins>
5068
<plugin>
5169
<groupId>org.apache.maven.plugins</groupId>
5270
<artifactId>maven-surefire-plugin</artifactId>
53-
<version>2.22.2</version>
71+
<version>${maven-surefire-plugin.version}</version>
5472
<configuration>
5573
<environmentVariables>
5674
<DEPS_DIR>${deps.dir}</DEPS_DIR>
@@ -79,12 +97,12 @@
7997
<plugin>
8098
<groupId>org.codehaus.gmaven</groupId>
8199
<artifactId>groovy-maven-plugin</artifactId>
82-
<version>2.1.1</version>
100+
<version>${groovy-maven-plugin.version}</version>
83101
<dependencies>
84102
<dependency>
85103
<groupId>org.codehaus.groovy</groupId>
86104
<artifactId>groovy-all</artifactId>
87-
<version>2.4.17</version>
105+
<version>${groovy.version}</version>
88106
</dependency>
89107
</dependencies>
90108
<executions>
@@ -127,7 +145,7 @@
127145

128146
<plugin>
129147
<artifactId>maven-compiler-plugin</artifactId>
130-
<version>3.8.1</version>
148+
<version>${maven-compiler-plugin.version}</version>
131149
<configuration>
132150
<source>1.8</source>
133151
<target>1.8</target>
@@ -138,6 +156,30 @@
138156
</configuration>
139157
</plugin>
140158

159+
<plugin>
160+
<groupId>com.diffplug.spotless</groupId>
161+
<artifactId>spotless-maven-plugin</artifactId>
162+
<version>${spotless.version}</version>
163+
<configuration>
164+
<java>
165+
<googleJavaFormat>
166+
<version>${google-java-format.version}</version>
167+
<style>GOOGLE</style>
168+
</googleJavaFormat>
169+
</java>
170+
<!-- <ratchetFrom>origin/main</ratchetFrom>-->
171+
<licenseHeader> <!-- specify either content or file, but not both -->
172+
<content>// This Source Code Form is subject to the terms of the Mozilla Public
173+
// License, v. 2.0. If a copy of the MPL was not distributed with this
174+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
175+
//
176+
// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved.
177+
//
178+
</content>
179+
</licenseHeader>
180+
</configuration>
181+
</plugin>
182+
141183
</plugins>
142184
</build>
143185
</project>

0 commit comments

Comments
 (0)