committed by
Artem Bilan
parent
a148e4af31
commit
79fceba98b
@@ -76,7 +76,7 @@ subprojects { subproject ->
|
||||
}
|
||||
|
||||
ext {
|
||||
assertjVersion = '3.4.1'
|
||||
assertjVersion = '2.5.0'
|
||||
hamcrestVersion = '1.3'
|
||||
jacksonVersion = '2.6.7'
|
||||
junitVersion = '4.12'
|
||||
|
||||
@@ -128,7 +128,9 @@ public class ConcurrentMessageListenerContainerTests {
|
||||
template.sendDefault(2, "qux");
|
||||
template.flush();
|
||||
assertThat(latch.await(60, TimeUnit.SECONDS)).isTrue();
|
||||
assertThat(listenerThreadNames).allMatch(threadName -> threadName.contains("-consumer-"));
|
||||
for (String threadName : listenerThreadNames) {
|
||||
assertThat(threadName).contains("-consumer-");
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
List<KafkaMessageListenerContainer<Integer, String>> containers = KafkaTestUtils.getPropertyValue(container,
|
||||
"containers", List.class);
|
||||
@@ -193,7 +195,9 @@ public class ConcurrentMessageListenerContainerTests {
|
||||
assertThat(latch.await(60, TimeUnit.SECONDS)).isTrue();
|
||||
assertThat(rebalancePartitionsAssignedLatch.await(60, TimeUnit.SECONDS)).isTrue();
|
||||
assertThat(rebalancePartitionsRevokedLatch.await(60, TimeUnit.SECONDS)).isTrue();
|
||||
assertThat(listenerThreadNames).allMatch(threadName -> threadName.contains("-consumer-"));
|
||||
for (String threadName : listenerThreadNames) {
|
||||
assertThat(threadName).contains("-consumer-");
|
||||
}
|
||||
container.stop();
|
||||
this.logger.info("Stop auto");
|
||||
}
|
||||
@@ -231,7 +235,9 @@ public class ConcurrentMessageListenerContainerTests {
|
||||
template.sendDefault(2, "qux");
|
||||
template.flush();
|
||||
assertThat(latch.await(60, TimeUnit.SECONDS)).isTrue();
|
||||
assertThat(listenerThreadNames).allMatch(threadName -> threadName.contains("-listener-"));
|
||||
for (String threadName : listenerThreadNames) {
|
||||
assertThat(threadName).contains("-listener-");
|
||||
}
|
||||
container.stop();
|
||||
this.logger.info("Stop manual");
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package org.springframework.kafka.support.serializer;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
@@ -92,10 +92,17 @@ public class JsonSerializationTests {
|
||||
*/
|
||||
@Test
|
||||
public void testDeserializeSerializedDummyException() {
|
||||
assertThatExceptionOfType(SerializationException.class)
|
||||
.isThrownBy(() -> jsonReader.deserialize(topic, stringWriter.serialize(topic, "dummy")))
|
||||
.withMessageStartingWith("Can't deserialize data [")
|
||||
.withCauseExactlyInstanceOf(JsonParseException.class);
|
||||
try {
|
||||
jsonReader.deserialize(topic, stringWriter.serialize(topic, "dummy"));
|
||||
fail("Expected SerializationException");
|
||||
}
|
||||
catch (SerializationException e) {
|
||||
assertThat(e.getMessage()).startsWith("Can't deserialize data [");
|
||||
assertThat(e.getCause()).isInstanceOf(JsonParseException.class);
|
||||
}
|
||||
catch (Exception e) {
|
||||
fail("Expected SerializationException, not " + e.getClass());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user