Skip to content

Commit

Permalink
fix: ut error
Browse files Browse the repository at this point in the history
  • Loading branch information
emptyOVO committed Nov 17, 2024
1 parent c8e4d05 commit 5aec945
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,10 @@ public static boolean onlineScheduleForProcessDef(String scheduleUrl, int schedu
JsonObject response = executeHttpRequest(url, POST, new HashMap<>(), header);
LOGGER.info("online schedule for process definition success, response data: {}", response);

return response.get(DS_RESPONSE_DATA).getAsBoolean();
if (response != null && !response.get(DS_RESPONSE_DATA).isJsonNull()) {
return response.get(DS_RESPONSE_DATA).getAsBoolean();
}
return false;

} catch (JsonParseException e) {
LOGGER.error("JsonParseException during online schedule", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ public abstract class DolphinScheduleContainerTestEnv extends BaseScheduleTest {

private static final Network NETWORK = Network.newNetwork();

// DS env generated final url and final token
protected static String DS_URL;
protected static String DS_TOKEN;

protected static final GenericContainer<?> dolphinSchedulerContainer =
new GenericContainer<>(DS_IMAGE_NAME + ":" + DS_IMAGE_TAG)
.withExposedPorts(12345, 25333)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.api.Timeout;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.ComponentScan;

import javax.annotation.Resource;

import java.util.Arrays;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand All @@ -41,7 +42,7 @@
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class DolphinScheduleEngineTest extends DolphinScheduleContainerTestEnv {

@Autowired
@Resource
private DolphinScheduleEngine dolphinScheduleEngine;

@BeforeAll
Expand Down

0 comments on commit 5aec945

Please sign in to comment.