use of io.camunda.zeebe.test.util.actuator.PartitionsActuatorClient.PartitionStatus in project zeebe by camunda.
the class ContainerStateAssert method hasNoSnapshotAvailable.
@SuppressWarnings("ConstantConditions")
public ContainerStateAssert hasNoSnapshotAvailable(final int partitionId) {
final Either<Throwable, Map<String, PartitionStatus>> response = actual.getPartitionsActuatorClient().queryPartitions();
if (response.isLeft()) {
failWithMessage("expected partitions query to be successful, but was %s", response.getLeft());
}
final Map<String, PartitionStatus> partitions = response.get();
final PartitionStatus partitionStatus = partitions.get(String.valueOf(partitionId));
if (partitionStatus == null) {
failWithMessage("expected partitions query to return info about partition %d, but got %s", partitionId, partitions.keySet());
}
// disable the warning
if (partitionStatus.snapshotId != null && !partitionStatus.snapshotId.isBlank()) {
failWithMessage("expected to have no snapshot, but got %s", partitionStatus.snapshotId);
}
return myself;
}
use of io.camunda.zeebe.test.util.actuator.PartitionsActuatorClient.PartitionStatus in project zeebe by zeebe-io.
the class ContainerStateAssert method hasNoSnapshotAvailable.
@SuppressWarnings("ConstantConditions")
public ContainerStateAssert hasNoSnapshotAvailable(final int partitionId) {
final Either<Throwable, Map<String, PartitionStatus>> response = actual.getPartitionsActuatorClient().queryPartitions();
if (response.isLeft()) {
failWithMessage("expected partitions query to be successful, but was %s", response.getLeft());
}
final Map<String, PartitionStatus> partitions = response.get();
final PartitionStatus partitionStatus = partitions.get(String.valueOf(partitionId));
if (partitionStatus == null) {
failWithMessage("expected partitions query to return info about partition %d, but got %s", partitionId, partitions.keySet());
}
// disable the warning
if (partitionStatus.snapshotId != null && !partitionStatus.snapshotId.isBlank()) {
failWithMessage("expected to have no snapshot, but got %s", partitionStatus.snapshotId);
}
return myself;
}
use of io.camunda.zeebe.test.util.actuator.PartitionsActuatorClient.PartitionStatus in project zeebe by zeebe-io.
the class ContainerStateAssert method hasSnapshotAvailable.
@SuppressWarnings("ConstantConditions")
public ContainerStateAssert hasSnapshotAvailable(final int partitionId) {
final Either<Throwable, Map<String, PartitionStatus>> response = actual.getPartitionsActuatorClient().queryPartitions();
if (response.isLeft()) {
failWithMessage("expected partitions query to be successful, but was %s", response.getLeft());
}
final Map<String, PartitionStatus> partitions = response.get();
final PartitionStatus partitionStatus = partitions.get(String.valueOf(partitionId));
if (partitionStatus == null) {
failWithMessage("expected partitions query to return info about partition %d, but got %s", partitionId, partitions.keySet());
}
// disable the warning
if (partitionStatus.snapshotId == null || partitionStatus.snapshotId.isBlank()) {
failWithMessage("expected to have a snapshot, but got nothing");
}
return myself;
}
use of io.camunda.zeebe.test.util.actuator.PartitionsActuatorClient.PartitionStatus in project zeebe by camunda-cloud.
the class ContainerStateAssert method hasSnapshotAvailable.
@SuppressWarnings("ConstantConditions")
public ContainerStateAssert hasSnapshotAvailable(final int partitionId) {
final Either<Throwable, Map<String, PartitionStatus>> response = actual.getPartitionsActuatorClient().queryPartitions();
if (response.isLeft()) {
failWithMessage("expected partitions query to be successful, but was %s", response.getLeft());
}
final Map<String, PartitionStatus> partitions = response.get();
final PartitionStatus partitionStatus = partitions.get(String.valueOf(partitionId));
if (partitionStatus == null) {
failWithMessage("expected partitions query to return info about partition %d, but got %s", partitionId, partitions.keySet());
}
// disable the warning
if (partitionStatus.snapshotId == null || partitionStatus.snapshotId.isBlank()) {
failWithMessage("expected to have a snapshot, but got nothing");
}
return myself;
}
use of io.camunda.zeebe.test.util.actuator.PartitionsActuatorClient.PartitionStatus in project zeebe by camunda-cloud.
the class ContainerStateAssert method hasNoSnapshotAvailable.
@SuppressWarnings("ConstantConditions")
public ContainerStateAssert hasNoSnapshotAvailable(final int partitionId) {
final Either<Throwable, Map<String, PartitionStatus>> response = actual.getPartitionsActuatorClient().queryPartitions();
if (response.isLeft()) {
failWithMessage("expected partitions query to be successful, but was %s", response.getLeft());
}
final Map<String, PartitionStatus> partitions = response.get();
final PartitionStatus partitionStatus = partitions.get(String.valueOf(partitionId));
if (partitionStatus == null) {
failWithMessage("expected partitions query to return info about partition %d, but got %s", partitionId, partitions.keySet());
}
// disable the warning
if (partitionStatus.snapshotId != null && !partitionStatus.snapshotId.isBlank()) {
failWithMessage("expected to have no snapshot, but got %s", partitionStatus.snapshotId);
}
return myself;
}
Aggregations