fix(java-sdk): fix followDependenciesExecution return type#128
Conversation
|
Hello, I think we will need an issue and a reproducer because I dont think your changes are correct. On the other side, with the current If you want to do further test on your side, you can use the beginning of the run-tests.sh script to publish a local version of the lib locally and use it on your own project. Side note for information: Our SDK is auto-generated, so please avoid modifying source files as changes will be overwritten. Specifically, methods using SSE are overridden during generation (see reference here), but we can handle that specific modification internally. Thanks for the contribution! |
|
Hi @Skraye, I might be using a different setup than your. Then I slightly modified the @Test
public void followDependenciesExecution() throws Exception {
Execution execution = createdExecution(LOG_FLOW, StateType.SUCCESS);
String executionId = execution.getId();
CountDownLatch completionLatch = new CountDownLatch(1);
kestraClient().executions().followDependenciesExecution(executionId, MAIN_TENANT, false, true)
.toStream()
.forEach(e -> assertNotNull(e.getId()));
kestraClient().executions().followDependenciesExecution(executionId, MAIN_TENANT, false, true)
.doOnNext(event -> {
assertThat(event.getFlowId()).isEqualTo(execution.getFlowId());
})
.doFinally(signalType -> {
completionLatch.countDown();
})
.subscribe();
boolean completed = completionLatch.await(30, TimeUnit.SECONDS);
assertThat(completed).isTrue();
}I do get the following assertion error: expected: not <null>
org.opentest4j.AssertionFailedError: expected: not <null>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:152)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertNotNull.failNull(AssertNotNull.java:49)
at org.junit.jupiter.api.AssertNotNull.assertNotNull(AssertNotNull.java:35)
at org.junit.jupiter.api.AssertNotNull.assertNotNull(AssertNotNull.java:30)
at org.junit.jupiter.api.Assertions.assertNotNull(Assertions.java:301)
at io.kestra.example.ExecutionsApiTest.lambda$followDependenciesExecution$47(ExecutionsApiTest.java:1056)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)What I don't understand is that the base test doest work event without my addition. If i switch the return type to Thank your for pointing out the overwriting issue with the template ! |
264ae3e to
00d1c57
Compare
|
Checked again, see my error, and you are right! |
|
@ClemDoum can you rebase your branch so I can merge it ? I dont have permission to commit on your branch |
00d1c57 to
ca9e40a
Compare
|
rebase done @Skraye |


What changes are being made and why?
The
/api/v1/{tenant}/executions/{executionId}/follow-dependenciesAPI routes returns a stream ofExecutionStatusEventyet the client code deserialize the event stream as a stream ofExecutionwhich ends up in a stream of empty objects when callingKestraClient().builder().executions().followDependenciesExecution(executionId, MAIN_TENANT, false, true)(because property names don't match)How the changes have been QAed?
Before:
return a list of empty
Executionobjects (null properties every everywhereAfter:
should return a list of valid
ExecutionStatusEvent(I wasn't able to test properly as I wasn't able to setup unit test properly)