Skip to content

Commit

Permalink
DT-1680 DT-1681 Not expecting exchange in out-of-band actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gj0dcsa committed Sep 30, 2024
1 parent 5f948bb commit 7017785
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public boolean isInputRequired() {
return false;
}

public boolean hasMatchedExchange() {
return matchedExchangeUuid != null;
public boolean isMissingMatchedExchange() {
return matchedExchangeUuid == null;
}

/**
Expand Down Expand Up @@ -175,6 +175,7 @@ protected boolean expectsNotificationExchange() {
return false;
}

@SuppressWarnings("unused")
protected void doHandleNotificationExchange(ConformanceExchange exchange) {}

public final ConformanceCheck createFullCheck(String expectedApiVersion) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public boolean isConfirmationRequired() {
return true;
}

@Override
public boolean isMissingMatchedExchange() {
return false;
}

@Override
public Supplier<String> getSrrSupplier() {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,14 @@ public ObjectNode asJsonNode() {
node.set("csp", getCspSupplier().get().toJson());
return node;
}

@Override
public boolean isConfirmationRequired() {
return true;
}

@Override
public boolean isMissingMatchedExchange() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public void completeCurrentAction() {
.formatted(currentScenario.toString()));
return;
}
if (!nextAction.hasMatchedExchange()) {
if (nextAction.isMissingMatchedExchange()) {
throw new UserFacingException(
"A required API exchange was not yet detected for action '%s'"
.formatted(nextAction.getActionTitle()));
Expand Down

0 comments on commit 7017785

Please sign in to comment.