Skip to content

Commit

Permalink
test: refactor exporter configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
deepthidevaki committed Jun 13, 2024
1 parent 1836489 commit 4c30b88
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import static io.camunda.zeebe.test.StableValuePredicate.hasStableValue;
import static org.assertj.core.api.Assertions.assertThat;

import io.camunda.zeebe.broker.shared.BrokerConfiguration.BrokerProperties;
import io.camunda.zeebe.broker.system.configuration.ExporterCfg;
import io.camunda.zeebe.client.ZeebeClient;
import io.camunda.zeebe.exporter.api.Exporter;
import io.camunda.zeebe.exporter.api.context.Context;
Expand Down Expand Up @@ -58,18 +56,19 @@ final class ExporterEnableTest {
// We have to restart brokers in the test. So use standalone gateway to avoid potentially
// accessing an unavailable broker
.withGatewaysCount(1)
.withBrokerConfig(b -> withCustomerExporters(b.brokerConfig()))
.withBrokerConfig(
b ->
b.withExporter(
EXPORTER_ID_1,
config -> config.setClassName(TestExporter.class.getName()))
.withExporter(
EXPORTER_ID_2,
config -> config.setClassName(TestExporter.class.getName())))
.build();

@AutoCloseResource private ZeebeClient client;
private ExportersActuator actuator;

private void withCustomerExporters(final BrokerProperties brokerConfig) {
final ExporterCfg exporterCfg = new ExporterCfg();
exporterCfg.setClassName(TestExporter.class.getName());
brokerConfig.setExporters(Map.of(EXPORTER_ID_1, exporterCfg, EXPORTER_ID_2, exporterCfg));
}

@BeforeEach
void setup() {
client = cluster.newClientBuilder().build();
Expand Down

0 comments on commit 4c30b88

Please sign in to comment.