Skip to content

Commit

Permalink
connector fix executeTask logic error (#1197)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhir authored Jan 10, 2024
1 parent 8b3f03b commit a74e518
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ public void executeTask(@Valid ExecuteTaskCommand command) {
log.info("Execute task with command {}", command);

if (StringUtils.isNotBlank(command.getMessageName())) {
emitEventOutPort.emitEvent(command.getDestination(), command.getType(), command.getInstanceId(), command.getData());

} else {
emitEventOutPort.emitEvent(command.getMessageName(), command.getDestination(), command.getType(), command.getInstanceId(), command.getData());

} else {
emitEventOutPort.emitEvent(command.getDestination(), command.getType(), command.getInstanceId(), command.getData());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void executeTask_shouldCallEmitEventWithCorrectParametersWhenMessageNameIsNotBla
useCase.executeTask(command);

// Assert
verify(emitEventOutPort).emitEvent(command.getDestination(), command.getType(), command.getInstanceId(), command.getData());
verify(emitEventOutPort).emitEvent(command.getMessageName(), command.getDestination(), command.getType(), command.getInstanceId(), command.getData());
}

@Test
Expand All @@ -53,6 +53,6 @@ void executeTask_shouldCallEmitEventWithDifferentParametersWhenMessageNameIsBlan
useCase.executeTask(command);

// Assert
verify(emitEventOutPort).emitEvent(command.getMessageName(), command.getDestination(), command.getType(), command.getInstanceId(), command.getData());
verify(emitEventOutPort).emitEvent(command.getDestination(), command.getType(), command.getInstanceId(), command.getData());
}
}

0 comments on commit a74e518

Please sign in to comment.