Fix Sonar issues
This commit is contained in:
@@ -102,8 +102,12 @@ public final class KafkaConditions {
|
||||
|
||||
@Override
|
||||
public boolean matches(ConsumerRecord<K, ?> value) {
|
||||
return value != null && ((value.key() == null && this.key == null)
|
||||
|| (value.key() != null && value.key().equals(this.key)));
|
||||
if (value == null) {
|
||||
return false;
|
||||
}
|
||||
return value.key() == null
|
||||
? this.key == null
|
||||
: value.key().equals(this.key);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -119,9 +123,12 @@ public final class KafkaConditions {
|
||||
|
||||
@Override
|
||||
public boolean matches(ConsumerRecord<?, V> value) {
|
||||
return value != null
|
||||
&& (value.value() == null && this.payload == null
|
||||
|| (value.value() != null && value.value().equals(this.payload)));
|
||||
if (value == null) {
|
||||
return false;
|
||||
}
|
||||
return value.value() == null
|
||||
? this.payload == null
|
||||
: value.value().equals(this.payload);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ public final class KafkaTestUtils {
|
||||
});
|
||||
reset.forEach((tp, off) -> consumer.seek(tp, off));
|
||||
try {
|
||||
Thread.sleep(50);
|
||||
Thread.sleep(50); // NOSONAR magic#
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
|
||||
Reference in New Issue
Block a user