-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
h1alexbel
committed
Jun 27, 2023
1 parent
2a01223
commit 1b31065
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
src/test/java/io/github/eocqrs/kafka/parameters/KfFlexibleEnvelopeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package io.github.eocqrs.kafka.parameters; | ||
|
||
import io.github.eocqrs.kafka.Params; | ||
import org.apache.kafka.clients.consumer.KafkaConsumer; | ||
import org.apache.kafka.clients.producer.KafkaProducer; | ||
import org.cactoos.map.MapOf; | ||
import org.hamcrest.MatcherAssert; | ||
import org.hamcrest.Matchers; | ||
import org.junit.jupiter.api.Test; | ||
|
||
/** | ||
* Test case for {@link KfFlexibleEnvelope}. | ||
* | ||
* @author Aliaksei Bialiauski (abialiauski.dev@gmail.com) | ||
* @since 0.3.5 | ||
*/ | ||
final class KfFlexibleEnvelopeTest { | ||
|
||
@Test | ||
void createsWithEnvelope() { | ||
final KfFlexibleEnvelope<String, String> envelope = | ||
new KfFlexibleEnvelopeTest.Example( | ||
new KfParams( | ||
new ClientId("test") | ||
) | ||
); | ||
MatcherAssert.assertThat( | ||
"Creates with Envelope", | ||
envelope, | ||
Matchers.notNullValue() | ||
); | ||
} | ||
|
||
private static class Example extends KfFlexibleEnvelope<String, String> { | ||
|
||
protected Example(final Params params) { | ||
super(params); | ||
} | ||
|
||
@Override | ||
public KafkaConsumer<String, String> consumer() { | ||
return new KafkaConsumer<>(new MapOf<>()); | ||
} | ||
|
||
@Override | ||
public KafkaProducer<String, String> producer() { | ||
return new KafkaProducer<>(new MapOf<>()); | ||
} | ||
} | ||
} |