2 tests
This commit is contained in:
@@ -248,6 +248,31 @@ class TransitionLinkerEnricherTest {
|
|||||||
assertThat(updatedChain.getMatchedTransitions()).isNullOrEmpty();
|
assertThat(updatedChain.getMatchedTransitions()).isNullOrEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void shouldExecuteDeterministicallyAndUtilizeInternalCaches() {
|
||||||
|
Transition t1 = new Transition();
|
||||||
|
t1.setSourceStates(List.of(State.of("NEW", "NEW")));
|
||||||
|
t1.setTargetStates(List.of(State.of("PAID", "PAID")));
|
||||||
|
t1.setEvent(Event.of("PAY", "PAY"));
|
||||||
|
|
||||||
|
CallChain chain1 = CallChain.builder().triggerPoint(TriggerPoint.builder().event("PAY").build()).build();
|
||||||
|
CallChain chain2 = CallChain.builder().triggerPoint(TriggerPoint.builder().event("PAY").build()).build();
|
||||||
|
CallChain chain3 = CallChain.builder().triggerPoint(TriggerPoint.builder().event("PAY").build()).build();
|
||||||
|
|
||||||
|
AnalysisResult result = AnalysisResult.builder()
|
||||||
|
.transitions(List.of(t1))
|
||||||
|
.metadata(CodebaseMetadata.builder().callChains(List.of(chain1, chain2, chain3)).build())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
enricher.enrich(result, null, null);
|
||||||
|
|
||||||
|
// All 3 identical trigger point chains should be linked seamlessly using the memoization cache.
|
||||||
|
for (CallChain chain : result.getMetadata().getCallChains()) {
|
||||||
|
assertThat(chain.getMatchedTransitions()).hasSize(1);
|
||||||
|
assertThat(chain.getMatchedTransitions().get(0).getEvent()).isEqualTo("PAY");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void shouldFilterCrossStateMachineRoutingByVertical() {
|
void shouldFilterCrossStateMachineRoutingByVertical() {
|
||||||
|
|||||||
Reference in New Issue
Block a user