congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
IncidentRecordStream
Code IndexAdd Tabnine to your IDE (free)

How to use
IncidentRecordStream
in
io.zeebe.test.util.record

Best Java code snippets using io.zeebe.test.util.record.IncidentRecordStream (Showing top 20 results out of 315)

origin: io.zeebe/zeebe-protocol-test-util

public Record<IncidentRecordValue> receiveFirstIncidentEvent(
  final long wfInstanceKey, final Intent intent) {
 return receiveIncidents().withIntent(intent).withWorkflowInstanceKey(wfInstanceKey).getFirst();
}
origin: zeebe-io/zeebe

@Override
protected IncidentRecordStream supply(final Stream<Record<IncidentRecordValue>> wrappedStream) {
 return new IncidentRecordStream(wrappedStream);
}
origin: zeebe-io/zeebe

public Record<IncidentRecordValue> receiveFirstIncidentCommand(final IncidentIntent intent) {
 return receiveIncidents().withIntent(intent).onlyCommands().getFirst();
}
origin: zeebe-io/zeebe

public Record<IncidentRecordValue> receiveFirstIncidentEvent(final IncidentIntent intent) {
 return receiveIncidents().withIntent(intent).getFirst();
}
origin: io.zeebe/zeebe-broker-core

 @Test
 public void shouldResolveIncidentIfCorrelationKeyNotFound() {
  // given
  final long workflowInstance = testClient.createWorkflowInstance(PROCESS_ID);

  final Record<IncidentRecordValue> incidentCreatedRecord =
    RecordingExporter.incidentRecords(IncidentIntent.CREATED).getFirst();

  testClient.updatePayload(
    incidentCreatedRecord.getValue().getElementInstanceKey(), "{\"orderId\":\"order123\"}");

  // when
  testClient.resolveIncident(incidentCreatedRecord.getKey());

  // then
  assertThat(
      RecordingExporter.workflowInstanceSubscriptionRecords(
          WorkflowInstanceSubscriptionIntent.OPENED)
        .exists())
    .isTrue();

  final Record<IncidentRecordValue> incidentResolvedEvent =
    testClient.receiveFirstIncidentEvent(workflowInstance, RESOLVED);
  assertThat(incidentResolvedEvent.getKey()).isEqualTo(incidentCreatedRecord.getKey());
 }
}
origin: zeebe-io/zeebe

testClient
  .receiveIncidents()
  .skipUntil(e -> e.getMetadata().getIntent() == RESOLVED)
  .withIntent(IncidentIntent.CREATED)
  .getFirst();
testClient
  .receiveIncidents()
  .skipUntil(e -> e.getMetadata().getIntent() == RESOLVED)
  .skipUntil(e -> e.getMetadata().getIntent() == CREATED)
  .withIntent(RESOLVED)
  .getFirst();
origin: io.zeebe/zeebe-broker-core

testClient
  .receiveIncidents()
  .skipUntil(r -> r.getMetadata().getIntent() == IncidentIntent.RESOLVED)
  .withIntent(IncidentIntent.CREATED)
  .getFirst();
testClient
  .receiveIncidents()
  .skipUntil(r -> r.getMetadata().getIntent() == IncidentIntent.RESOLVED)
  .skipUntil(r -> r.getMetadata().getIntent() == IncidentIntent.CREATED)
  .limit(r -> r.getMetadata().getIntent() == IncidentIntent.RESOLVED)
  .collect(Collectors.toList());
origin: zeebe-io/zeebe

public static IncidentRecordStream incidentRecords(final IncidentIntent intent) {
 return incidentRecords().withIntent(intent);
}
origin: zeebe-io/zeebe

public IncidentRecordStream withErrorMessage(final String errorMessage) {
 return valueFilter(v -> errorMessage.equals(v.getErrorMessage()));
}
origin: zeebe-io/zeebe

testClient
  .receiveIncidents()
  .limit(r -> r.getMetadata().getIntent() == IncidentIntent.RESOLVED)
  .collect(Collectors.toList());
origin: io.zeebe/zeebe-protocol-test-util

public IncidentRecordStream receiveIncidents() {
 return RecordingExporter.incidentRecords().withPartitionId(partitionId);
}
origin: zeebe-io/zeebe

 @Test
 public void shouldResolveIncidentIfCorrelationKeyNotFound() {
  // given
  final long workflowInstance = testClient.createWorkflowInstance(PROCESS_ID);

  final Record<IncidentRecordValue> incidentCreatedRecord =
    RecordingExporter.incidentRecords(IncidentIntent.CREATED).getFirst();

  testClient.updatePayload(
    incidentCreatedRecord.getValue().getElementInstanceKey(), "{\"orderId\":\"order123\"}");

  // when
  testClient.resolveIncident(incidentCreatedRecord.getKey());

  // then
  assertThat(
    RecordingExporter.workflowInstanceSubscriptionRecords(
        WorkflowInstanceSubscriptionIntent.OPENED)
      .exists());

  final Record<IncidentRecordValue> incidentResolvedEvent =
    testClient.receiveFirstIncidentEvent(workflowInstance, RESOLVED);
  assertThat(incidentResolvedEvent.getKey()).isEqualTo(incidentCreatedRecord.getKey());
 }
}
origin: io.zeebe/zeebe-broker-core

testClient
  .receiveIncidents()
  .skipUntil(e -> e.getMetadata().getIntent() == RESOLVED)
  .withIntent(IncidentIntent.CREATED)
  .getFirst();
testClient
  .receiveIncidents()
  .skipUntil(e -> e.getMetadata().getIntent() == RESOLVED)
  .skipUntil(e -> e.getMetadata().getIntent() == CREATED)
  .withIntent(RESOLVED)
  .getFirst();
origin: zeebe-io/zeebe

testClient
  .receiveIncidents()
  .skipUntil(r -> r.getMetadata().getIntent() == IncidentIntent.RESOLVED)
  .withIntent(IncidentIntent.CREATED)
  .getFirst();
testClient
  .receiveIncidents()
  .skipUntil(r -> r.getMetadata().getIntent() == IncidentIntent.RESOLVED)
  .skipUntil(r -> r.getMetadata().getIntent() == IncidentIntent.CREATED)
  .limit(r -> r.getMetadata().getIntent() == IncidentIntent.RESOLVED)
  .collect(Collectors.toList());
origin: io.zeebe/zeebe-protocol-test-util

public Record<IncidentRecordValue> receiveFirstIncidentEvent(final IncidentIntent intent) {
 return receiveIncidents().withIntent(intent).getFirst();
}
origin: io.zeebe/zb-test-util

public static IncidentRecordStream incidentRecords(final IncidentIntent intent) {
 return incidentRecords().withIntent(intent);
}
origin: zeebe-io/zeebe

public IncidentRecordStream withBpmnProcessId(final String bpmnProcessId) {
 return valueFilter(v -> bpmnProcessId.equals(v.getBpmnProcessId()));
}
origin: io.zeebe/zeebe-broker-core

testClient
  .receiveIncidents()
  .limit(r -> r.getMetadata().getIntent() == IncidentIntent.RESOLVED)
  .collect(Collectors.toList());
origin: zeebe-io/zeebe

public IncidentRecordStream receiveIncidents() {
 return RecordingExporter.incidentRecords().withPartitionId(partitionId);
}
origin: zeebe-io/zeebe

  RecordingExporter.incidentRecords(IncidentIntent.CREATED).getFirst();
clientRule
  .getClient()
io.zeebe.test.util.recordIncidentRecordStream

Most used methods

  • getFirst
  • withIntent
  • <init>
  • collect
  • limit
  • onlyCommands
  • skipUntil
  • valueFilter
  • withPartitionId
  • withWorkflowInstanceKey

Popular in Java

  • Making http requests using okhttp
  • getContentResolver (Context)
  • addToBackStack (FragmentTransaction)
  • getSystemService (Context)
  • Menu (java.awt)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • ImageIO (javax.imageio)
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now