Codota Logo
CoreEvent.getItemSequenceInfo
Code IndexAdd Codota to your IDE (free)

How to use
getItemSequenceInfo
method
in
org.mule.runtime.core.api.event.CoreEvent

Best Java code snippets using org.mule.runtime.core.api.event.CoreEvent.getItemSequenceInfo (Showing top 9 results out of 315)

  • Common ways to obtain CoreEvent
private void myMethod () {
CoreEvent c =
  • Codota IconCoreEvent.Builder eventBuilder;eventBuilder.build()
  • Codota IconMuleContextUtils muleContextUtils;MuleContext muleContext;MuleContextUtils muleContextUtils2;Object object;muleContextUtils.eventBuilder(muleContext).message(muleContextUtils2.of(object)).build()
  • Smart code suggestions by Codota
}
origin: mulesoft/mule

 @Override
 public Supplier<CorrelationInfo> resolve(ExecutionContext executionContext) {
  return () -> {
   CoreEvent event = ((ExecutionContextAdapter) executionContext).getEvent();
   return new ImmutableCorrelationInfo(event.getContext().getId(), true, event.getCorrelationId(),
                     event.getItemSequenceInfo().orElse(null));
  };
 }
}
origin: mulesoft/mule

@Before
public void setUp() {
 when(event.getError()).thenReturn(empty());
 when(event.getAuthentication()).thenReturn(empty());
 Message msg = of(null);
 when(event.getMessage()).thenReturn(msg);
 when(event.asBindingContext()).thenReturn(getTargetBindingContext(msg));
 when(event.getItemSequenceInfo()).thenReturn(empty());
}
origin: mulesoft/mule

private CoreEvent getEventWithError(Optional<Error> error) {
 CoreEvent event = mock(CoreEvent.class, RETURNS_DEEP_STUBS);
 doReturn(error).when(event).getError();
 when(event.getMessage().getPayload()).thenReturn(new TypedValue<>(null, OBJECT));
 when(event.getMessage().getAttributes()).thenReturn(new TypedValue<>(null, OBJECT));
 when(event.getAuthentication()).thenReturn(empty());
 when(event.getItemSequenceInfo()).thenReturn(empty());
 return event;
}
origin: mulesoft/mule

@Test
public void noSequenceSizeItemSequenceInfoBinding() throws Exception {
 CoreEvent event = spy(testEvent());
 when(event.getItemSequenceInfo()).thenReturn(of(ItemSequenceInfo.of(43)));
 TypedValue result = expressionLanguage.evaluate(ITEM_SEQUENCE_INFO + ".position", event, BindingContext.builder().build());
 assertThat(result.getValue(), is(43));
 result = expressionLanguage.evaluate(ITEM_SEQUENCE_INFO + ".sequenceSize", event, BindingContext.builder().build());
 assertThat(result.getValue(), is(nullValue()));
}
origin: mulesoft/mule

@Test
public void itemSequenceInfoBinding() throws Exception {
 CoreEvent event = spy(testEvent());
 when(event.getItemSequenceInfo()).thenReturn(of(ItemSequenceInfo.of(43, 100)));
 TypedValue result = expressionLanguage.evaluate(ITEM_SEQUENCE_INFO + ".position", event, BindingContext.builder().build());
 assertThat(result.getValue(), is(43));
 result = expressionLanguage.evaluate(ITEM_SEQUENCE_INFO + ".sequenceSize", event, BindingContext.builder().build());
 assertThat(result.getValue(), is(100));
}
origin: org.mule.runtime/mule-core-tests

private CoreEvent getEventWithError(Optional<Error> error) {
 CoreEvent event = mock(CoreEvent.class, RETURNS_DEEP_STUBS);
 doReturn(error).when(event).getError();
 when(event.getMessage().getPayload()).thenReturn(new TypedValue<>(null, OBJECT));
 when(event.getMessage().getAttributes()).thenReturn(new TypedValue<>(null, OBJECT));
 when(event.getAuthentication()).thenReturn(empty());
 when(event.getItemSequenceInfo()).thenReturn(empty());
 return event;
}
origin: org.mule.runtime/mule-module-extensions-support

 @Override
 public LazyValue<CorrelationInfo> resolve(ExecutionContext executionContext) {
  return new LazyValue<>(() -> {
   CoreEvent event = ((ExecutionContextAdapter) executionContext).getEvent();
   return new ImmutableCorrelationInfo(event.getContext().getId(), true, event.getCorrelationId(),
                     event.getItemSequenceInfo().orElse(null));
  });
 }
}
origin: org.mule.runtime/mule-core-tests

@Test
public void noSequenceSizeItemSequenceInfoBinding() throws Exception {
 CoreEvent event = spy(testEvent());
 when(event.getItemSequenceInfo()).thenReturn(of(ItemSequenceInfo.of(43)));
 TypedValue result = expressionLanguage.evaluate(ITEM_SEQUENCE_INFO + ".position", event, BindingContext.builder().build());
 assertThat(result.getValue(), is(43));
 result = expressionLanguage.evaluate(ITEM_SEQUENCE_INFO + ".sequenceSize", event, BindingContext.builder().build());
 assertThat(result.getValue(), is(nullValue()));
}
origin: org.mule.runtime/mule-core-tests

@Test
public void itemSequenceInfoBinding() throws Exception {
 CoreEvent event = spy(testEvent());
 when(event.getItemSequenceInfo()).thenReturn(of(ItemSequenceInfo.of(43, 100)));
 TypedValue result = expressionLanguage.evaluate(ITEM_SEQUENCE_INFO + ".position", event, BindingContext.builder().build());
 assertThat(result.getValue(), is(43));
 result = expressionLanguage.evaluate(ITEM_SEQUENCE_INFO + ".sequenceSize", event, BindingContext.builder().build());
 assertThat(result.getValue(), is(100));
}
org.mule.runtime.core.api.eventCoreEventgetItemSequenceInfo

Popular methods of CoreEvent

  • getMessage
  • builder
  • getContext
  • getError
  • getVariables
  • getSecurityContext
  • asBindingContext
  • getCorrelationId
  • getFlowCallStack
  • getAuthentication
  • getGroupCorrelation
  • getVariableValueOrNull
    Helper method to get the value of a given variable in a null-safe manner such that null is returned
  • getGroupCorrelation,
  • getVariableValueOrNull

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • getSharedPreferences (Context)
  • getSystemService (Context)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now