Skip to content

Commit 73611bc

Browse files
authored
Unit test coverage (#1252)
* Unit test coverage * More coverage
1 parent f336bae commit 73611bc

11 files changed

+145
-336
lines changed

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,9 @@ jacocoTestReport {
166166
}
167167
afterEvaluate { // only report on main library not examples
168168
classDirectories.setFrom(files(classDirectories.files.collect {
169-
fileTree(dir: it,
170-
exclude: ['**/examples**'])
169+
fileTree(dir: it, exclude: [
170+
'**/examples/**', 'io/nats/client/support/Debug*'
171+
])
171172
}))
172173
}
173174
}

src/main/java/io/nats/client/Options.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1685,7 +1685,7 @@ public Builder serverPool(ServerPool serverPool) {
16851685
}
16861686

16871687
/**
1688-
* Set the DispatcherFactory implementation for connections to use instead of the default implementation
1688+
* Set the DispatcherFactory implementation for connections to use instead of the default implementation
16891689
* @param dispatcherFactory the implementation
16901690
* @return the Builder for chaining
16911691
*/

src/main/java/io/nats/client/api/MessageBatchGetRequest.java

Lines changed: 0 additions & 322 deletions
This file was deleted.

src/main/java/io/nats/client/support/Validator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,9 @@ public static String required(String s, String label) {
175175
return s;
176176
}
177177

178+
@Deprecated
178179
public static String required(String s1, String s2, String label) {
179-
if (emptyAsNull(s1) == null && emptyAsNull(s2) == null) {
180+
if (emptyAsNull(s1) == null || emptyAsNull(s2) == null) {
180181
throw new IllegalArgumentException(label + " cannot be null or empty.");
181182
}
182183
return s1;

src/test/java/io/nats/client/api/StreamConfigurationTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,10 @@ public void testSourceBase() {
345345
assertEquals(m1, mb.build());
346346
assertEquals(s1.hashCode(), sb.build().hashCode());
347347
assertEquals(m1.hashCode(), mb.build().hashCode());
348+
assertEquals(sb.subjectTransforms, m1.getSubjectTransforms());
349+
350+
// coverage
351+
m.getSubjectTransforms().get(0).toString();
348352
}
349353

350354
private void assertNotEqualsEqualsHashcode(Source s, Mirror m, Source.Builder sb, Mirror.Builder mb) {

0 commit comments

Comments
 (0)