Skip to content

Commit

Permalink
Polish "Add Pulsar Binder to Spring Cloud Stream"
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll committed Oct 23, 2023
1 parent 748148f commit 412353e
Showing 1 changed file with 13 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,14 @@ void springCloudStreamWithKafkaStreams(Version springBootVersion, Dependency tes
.hasDependenciesSize(5);
}

@ParameterizedTest
@MethodSource("springCloudStreamWithPulsarArguments")
void springCloudStreamWithPulsar(Version springBootVersion, Dependency testDependency) {
@Test
void springCloudStreamWithPulsar() {
ProjectRequest request = createProjectRequest("cloud-stream", "pulsar");
request.setBootVersion(springBootVersion.toString());
request.setBootVersion("3.2.0-RC1");
assertThat(mavenPom(request)).hasDependency(getDependency("cloud-stream"))
.hasDependency(getDependency("pulsar"))
.hasDependency(PULSAR_BINDER)
.hasDependency(Dependency.createSpringBootStarter("test", Dependency.SCOPE_TEST))
.hasDependency(testDependency)
.hasDependenciesSize(5);
.hasDependency(Dependency.createSpringBootStarter("test", Dependency.SCOPE_TEST));
}

@ParameterizedTest
Expand All @@ -119,28 +116,9 @@ void springCloudStreamWithAllBinders(Version springBootVersion, Dependency testD
.hasDependenciesSize(11);
}

@ParameterizedTest
@MethodSource("springCloudStreamWithPulsarArguments")
void springCloudStreamWithAllBindersInBoot32x(Version springBootVersion, Dependency testDependency) {
ProjectRequest request = createProjectRequest("cloud-stream", "amqp", "kafka", "kafka-streams", "pulsar");
request.setBootVersion(springBootVersion.toString());
assertThat(mavenPom(request)).hasDependency(getDependency("cloud-stream"))
.hasDependency(getDependency("amqp"))
.hasDependency(getDependency("kafka"))
.hasDependency(getDependency("kafka-streams"))
.hasDependency(getDependency("pulsar"))
.hasDependency(RABBIT_BINDER)
.hasDependency(KAFKA_BINDER)
.hasDependency(KAFKA_STREAMS_BINDER)
.hasDependency(PULSAR_BINDER)
.hasDependency(Dependency.createSpringBootStarter("test", Dependency.SCOPE_TEST))
.hasDependency(testDependency)
.hasDependenciesSize(13);
}

@ParameterizedTest
@MethodSource("springCloudStreamArguments")
void springCloudBusWithRabbit(Version springBootVersion, Dependency ignoredTestDependency) {
void springCloudBusWithRabbit(Version springBootVersion, Dependency testDependency) {
ProjectRequest request = createProjectRequest("cloud-bus", "amqp");
request.setBootVersion(springBootVersion.toString());
assertThat(mavenPom(request)).hasDependency(getDependency("cloud-bus"))
Expand All @@ -152,43 +130,29 @@ void springCloudBusWithRabbit(Version springBootVersion, Dependency ignoredTestD

@ParameterizedTest
@MethodSource("springCloudStreamArguments")
void springCloudBusWithKafka(Version springBootVersion, Dependency ignoredTestDependency) {
ProjectRequest request = createProjectRequest("cloud-bus", "kafka");
void springCloudBusWithKafka(Version springBootVersion, Dependency testDependency) {
ProjectRequest request = createProjectRequest("cloud-bus", "amqp");
request.setBootVersion(springBootVersion.toString());
assertThat(mavenPom(request)).hasDependency(getDependency("cloud-bus"))
.hasDependency(getDependency("kafka"))
.hasDependency(KAFKA_BINDER)
.hasDependency(getDependency("amqp"))
.hasDependency(RABBIT_BINDER)
.hasDependency(Dependency.createSpringBootStarter("test", Dependency.SCOPE_TEST))
.hasDependenciesSize(5);
}

@ParameterizedTest
@MethodSource("springCloudStreamWithPulsarArguments")
void springCloudBusWithPulsar(Version springBootVersion, Dependency ignoredTestDependency) {
ProjectRequest request = createProjectRequest("cloud-bus", "pulsar");
request.setBootVersion(springBootVersion.toString());
assertThat(mavenPom(request)).hasDependency(getDependency("cloud-bus"))
.hasDependency(getDependency("pulsar"))
.hasDependency(PULSAR_BINDER)
.hasDependency(Dependency.createSpringBootStarter("test", Dependency.SCOPE_TEST))
.hasDependenciesSize(4);
}

@ParameterizedTest
@MethodSource("springCloudStreamWithPulsarArguments")
void springCloudBusWithAllBindersInBoot32x(Version springBootVersion, Dependency ignoredTestDependency) {
ProjectRequest request = createProjectRequest("cloud-bus", "amqp", "kafka", "kafka-streams", "pulsar");
@MethodSource("springCloudStreamArguments")
void springCloudBusWithAllBinders(Version springBootVersion, Dependency testDependency) {
ProjectRequest request = createProjectRequest("cloud-bus", "amqp", "kafka", "kafka-streams");
request.setBootVersion(springBootVersion.toString());
assertThat(mavenPom(request)).hasDependency(getDependency("cloud-bus"))
.hasDependency(getDependency("amqp"))
.hasDependency(getDependency("kafka"))
.hasDependency(getDependency("kafka-streams"))
.hasDependency(getDependency("pulsar"))
.hasDependency(RABBIT_BINDER)
.hasDependency(KAFKA_BINDER)
.hasDependency(PULSAR_BINDER)
.hasDependency(Dependency.createSpringBootStarter("test", Dependency.SCOPE_TEST))
.hasDependenciesSize(11);
.hasDependenciesSize(9);
}

@Test
Expand All @@ -209,11 +173,4 @@ private static Stream<Arguments> springCloudStreamArguments() {
Arguments.of(Version.parse("3.0.0"), testBinder));
}

private static Stream<Arguments> springCloudStreamWithPulsarArguments() {
Dependency testBinder = Dependency.withId("cloud-stream-test", "org.springframework.cloud",
"spring-cloud-stream-test-binder", null, Dependency.SCOPE_TEST);
return Stream.of(Arguments.of(Version.parse("3.2.0-M3"), testBinder),
Arguments.of(Version.parse("3.2.0-RC1"), testBinder));
}

}

0 comments on commit 412353e

Please sign in to comment.