Search in sources :

Example 16 with ZeebeClient

use of io.zeebe.client.ZeebeClient in project zeebe by zeebe-io.

the class CreateTaskTest method testValidateTopicNameNotEmpty.

@Test
public void testValidateTopicNameNotEmpty() {
    // given
    final ZeebeClient client = clientRule.getClient();
    // then
    exception.expect(RuntimeException.class);
    exception.expectMessage("topic must not be empty");
    // when
    client.tasks().create("", "foo").execute();
}
Also used : ZeebeClient(io.zeebe.client.ZeebeClient) Test(org.junit.Test)

Example 17 with ZeebeClient

use of io.zeebe.client.ZeebeClient in project zeebe by zeebe-io.

the class CreateTaskTest method testValidateTopicNameNotNull.

@Test
public void testValidateTopicNameNotNull() {
    // given
    final ZeebeClient client = clientRule.getClient();
    // then
    exception.expect(RuntimeException.class);
    exception.expectMessage("topic must not be null");
    // when
    client.tasks().create(null, "foo").execute();
}
Also used : ZeebeClient(io.zeebe.client.ZeebeClient) Test(org.junit.Test)

Example 18 with ZeebeClient

use of io.zeebe.client.ZeebeClient in project zeebe by zeebe-io.

the class TopicSubscriptionTest method testValidateTopicNameNotNull.

@Test
public void testValidateTopicNameNotNull() {
    // given
    final ZeebeClient client = clientRule.getClient();
    // then
    exception.expect(RuntimeException.class);
    exception.expectMessage("topic must not be null");
    // when
    client.topics().newSubscription(null);
}
Also used : ZeebeClient(io.zeebe.client.ZeebeClient) Test(org.junit.Test)

Example 19 with ZeebeClient

use of io.zeebe.client.ZeebeClient in project zeebe by zeebe-io.

the class TopicSubscriptionTest method testValidateTopicNameNotEmpty.

@Test
public void testValidateTopicNameNotEmpty() {
    // given
    final ZeebeClient client = clientRule.getClient();
    // then
    exception.expect(RuntimeException.class);
    exception.expectMessage("topic must not be empty");
    // when
    client.topics().newSubscription("");
}
Also used : ZeebeClient(io.zeebe.client.ZeebeClient) Test(org.junit.Test)

Example 20 with ZeebeClient

use of io.zeebe.client.ZeebeClient in project zeebe by zeebe-io.

the class BrokerRecoveryTest method shouldNotCreatePreviouslyCreatedTopicAfterRestart.

@Test
public void shouldNotCreatePreviouslyCreatedTopicAfterRestart() {
    // given
    final ZeebeClient client = clientRule.getClient();
    final String topicName = "foo";
    client.topics().create(topicName, 2).execute();
    restartBroker();
    // then
    exception.expect(ClientCommandRejectedException.class);
    // when
    client.topics().create(topicName, 2).execute();
}
Also used : ZeebeClient(io.zeebe.client.ZeebeClient) Test(org.junit.Test)

Aggregations

ZeebeClient (io.zeebe.client.ZeebeClient)22 Test (org.junit.Test)15 ClientProperties (io.zeebe.client.ClientProperties)8 Properties (java.util.Properties)7 ZeebeClientImpl (io.zeebe.client.impl.ZeebeClientImpl)5 TaskEvent (io.zeebe.client.event.TaskEvent)4 TopologyBroker (io.zeebe.client.clustering.impl.TopologyBroker)3 TopologyResponse (io.zeebe.client.clustering.impl.TopologyResponse)3 Duration (java.time.Duration)3 Scanner (java.util.Scanner)3 BrokerPartitionState (io.zeebe.client.clustering.impl.BrokerPartitionState)2 ClientCommandRejectedException (io.zeebe.client.cmd.ClientCommandRejectedException)2 TaskSubscription (io.zeebe.client.task.TaskSubscription)2 Topic (io.zeebe.client.topic.Topic)2 Topics (io.zeebe.client.topic.Topics)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)2 Rule (org.junit.Rule)2 ClientRule (io.zeebe.broker.it.ClientRule)1