use of io.zeebe.test.broker.protocol.clientapi.ControlMessageRequestBuilder in project zeebe by zeebe-io.
the class TaskSubscriptionTest method shouldRejectSubscriptionWithoutLockOwner.
@Test
public void shouldRejectSubscriptionWithoutLockOwner() {
// given
final ControlMessageRequestBuilder request = apiRule.createControlMessageRequest().messageType(ControlMessageType.ADD_TASK_SUBSCRIPTION).partitionId(apiRule.getDefaultPartitionId()).data().put("taskType", "foo").put("lockDuration", 10000L).put("credits", 5).done();
// when
final ErrorResponse errorResponse = request.send().awaitError();
// then
assertThat(errorResponse).isNotNull();
assertThat(errorResponse.getErrorCode()).isEqualTo(ErrorCode.REQUEST_PROCESSING_FAILURE);
assertThat(errorResponse.getErrorData()).isEqualTo("Cannot add task subscription. lock owner must not be empty");
}
use of io.zeebe.test.broker.protocol.clientapi.ControlMessageRequestBuilder in project zeebe by zeebe-io.
the class TaskSubscriptionTest method shouldRejectSubscriptionWithZeroLockDuration.
@Test
public void shouldRejectSubscriptionWithZeroLockDuration() {
// given
final ControlMessageRequestBuilder request = apiRule.createControlMessageRequest().messageType(ControlMessageType.ADD_TASK_SUBSCRIPTION).partitionId(apiRule.getDefaultPartitionId()).data().put("taskType", "foo").put("lockDuration", 0).put("lockOwner", "bar").put("credits", 5).done();
// when
final ErrorResponse errorResponse = request.send().awaitError();
// then
assertThat(errorResponse).isNotNull();
assertThat(errorResponse.getErrorCode()).isEqualTo(ErrorCode.REQUEST_PROCESSING_FAILURE);
assertThat(errorResponse.getErrorData()).isEqualTo("Cannot add task subscription. lock duration must be greater than 0");
}
Aggregations