Skip to content
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

Merged
merged 2 commits into from
Jul 10, 2021
Merged

use junit5 to test all the modules #957

merged 2 commits into from
Jul 10, 2021

Conversation

lanwen
Copy link
Collaborator

@lanwen lanwen commented Jul 9, 2021

also:

  • bump testcontainers to 1.15.3 (as it can't find old ryuk)

also:
- bump testcontainers to 1.15.3 (as it can't find old ryuk)
- bump liiklus container in examples
@lanwen lanwen requested a review from bsideup July 9, 2021 20:25
GenericContainer<?> liiklus = new GenericContainer<>("bsideup/liiklus:0.9.0")
GenericContainer<?> liiklus = new GenericContainer<>("bsideup/liiklus:latest")
Copy link
Owner

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

}

dependencies {
dependencySet(group: "com.github.bsideup.liiklus", version: "0.9.0") {
dependencySet(group: "com.github.bsideup.liiklus", version: "0.10.0-rc1") {
Copy link
Owner

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

Comment on lines 18 to 24
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
)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated to this PR

Comment on lines 19 to 28
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();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated to this PR

Comment on lines 20 to 23
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");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated change

Comment on lines 54 to 64
.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()
)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated to this PR

Copy link
Collaborator Author

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())
Copy link
Owner

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

Comment on lines 20 to 21
return dependsOn(kafkaContainer)
.withKafka(kafkaContainer.getNetwork(), "PLAINTEXT://" + kafkaContainer.getNetworkAliases().get(0) + ":9093");
Copy link
Owner

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";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no :latest

@lanwen lanwen requested a review from bsideup July 9, 2021 21:11
Copy link
Owner

@bsideup bsideup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@bsideup bsideup merged commit d3c8213 into master Jul 10, 2021
@delete-merged-branch delete-merged-branch bot deleted the junit5 branch July 10, 2021 06:30
@bsideup bsideup added this to the next milestone Jul 10, 2021
@bsideup bsideup added the dependencies Pull requests that update a dependency file label Jul 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants