-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use junit5 to test all the modules #957
Conversation
also: - bump testcontainers to 1.15.3 (as it can't find old ryuk) - bump liiklus container in examples
GenericContainer<?> liiklus = new GenericContainer<>("bsideup/liiklus:0.9.0") | ||
GenericContainer<?> liiklus = new GenericContainer<>("bsideup/liiklus:latest") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not use :latest
here - may break the build unexpectedly
examples/plugin/build.gradle
Outdated
} | ||
|
||
dependencies { | ||
dependencySet(group: "com.github.bsideup.liiklus", version: "0.9.0") { | ||
dependencySet(group: "com.github.bsideup.liiklus", version: "0.10.0-rc1") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outside of the scope of this PR
return new Record( | ||
record.getEnvelope().withValue(ByteBuffer.wrap("**masked**".getBytes())), | ||
record.getTimestamp(), | ||
record.getPartition(), | ||
record.getOffset() | ||
LiiklusCloudEvent value = (LiiklusCloudEvent) record.getEnvelope().getRawValue(); | ||
return record.withEnvelope(record.getEnvelope() | ||
.withValue( | ||
value.withData(ByteBuffer.wrap("**masked**".getBytes())), | ||
LiiklusCloudEvent::asJson | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated to this PR
LiiklusCloudEvent event; | ||
if (envelope.getRawValue() instanceof LiiklusCloudEvent) { | ||
event = (LiiklusCloudEvent) envelope.getRawValue(); | ||
} else { | ||
CompletableFuture<Envelope> completableFuture = new CompletableFuture<>(); | ||
completableFuture.completeExceptionally(new IllegalArgumentException("raw value have to be LiiklusCloudEvent, got: " + envelope.getRawValue().getClass().getName())); | ||
return completableFuture; | ||
} | ||
|
||
String value = event.getData().map(StandardCharsets.UTF_8::decode).orElse(CharBuffer.wrap("empty-string")).toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated to this PR
Record record = receiveRecords(key).blockFirst(Duration.ofSeconds(10)); | ||
ReceiveReply.LiiklusEventRecord record = receiveRecords(key).blockFirst(Duration.ofSeconds(10)); | ||
|
||
assertThat(record).isNotNull().satisfies(it -> { | ||
assertThat(it.getValue().toStringUtf8()).isEqualTo("!olleH"); | ||
assertThat(it.getEvent().getData().toStringUtf8()).isEqualTo("!olleH"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated change
.setLiiklusEvent( | ||
LiiklusEvent.newBuilder() | ||
.setId(UUID.randomUUID().toString()) | ||
.setType("com.example.event") | ||
.setSource("/tests") | ||
.setDataContentType("application/json") | ||
.putExtensions("comexampleextension1", "foo") | ||
.setData(ByteString.copyFromUtf8(value)) | ||
.setTime(ZonedDateTime.now().format(DateTimeFormatter.ISO_OFFSET_DATE_TIME)) | ||
.buildPartial() | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated to this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, yeah, I've got it :) will split as well.
import java.util.UUID; | ||
|
||
public abstract class AbstractIntegrationTest { | ||
|
||
protected static final LiiklusClient client; | ||
|
||
static { | ||
LiiklusContainer liiklus = new LiiklusContainer("0.7.0") | ||
LiiklusContainer liiklus = new LiiklusContainer(LiiklusContainer.class.getPackage().getImplementationVersion()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated, also I would not use "always the latest" here
return dependsOn(kafkaContainer) | ||
.withKafka(kafkaContainer.getNetwork(), "PLAINTEXT://" + kafkaContainer.getNetworkAliases().get(0) + ":9093"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated change
|
||
public class LiiklusContainerTest { | ||
|
||
static final String LATEST_VERSION = "0.7.0"; | ||
static KafkaContainer kafka = new KafkaContainer(); | ||
static final String LATEST_VERSION = "latest"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no :latest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
also: