protected static String accessToken() {
        Map<String, String> loginParams = new HashMap<>();
        loginParams.put(DS_USERNAME, DS_DEFAULT_USERNAME);
        loginParams.put(DS_PASSWORD, DS_DEFAULT_PASSWORD);
        try {
            JsonObject loginResponse =
                    executeHttpRequest(DS_DEFAULT_SERVICE_URL + DS_LOGIN_URL, loginParams, new HashMap<>());
            if (loginResponse.get("success").getAsBoolean()) {
                String tokenGenUrl = DS_DEFAULT_SERVICE_URL + DS_TOKEN_URL + DS_TOKEN_GEN_URL;
                Map<String, String> tokenParams = new HashMap<>();
                tokenParams.put(DS_USERID, String.valueOf(DS_DEFAULT_USERID));

                LocalDateTime now = LocalDateTime.now();
                LocalDateTime tomorrow = now.plusDays(1);
                DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DS_EXPIRE_TIME_FORMAT);
                String expireTime = tomorrow.format(formatter);
                tokenParams.put(DS_EXPIRE_TIME, expireTime);

                Map<String, String> cookies = new HashMap<>();
                cookies.put(DS_COOKIE_SC_TYPE, loginResponse.get(DS_RESPONSE_DATA)
                        .getAsJsonObject().get(DS_COOKIE_SC_TYPE).getAsString());
                cookies.put(DS_COOKIE_SESSION_ID, loginResponse.get(DS_RESPONSE_DATA)
                        .getAsJsonObject().get(DS_COOKIE_SESSION_ID).getAsString());

                JsonObject tokenGenResponse = executeHttpRequest(tokenGenUrl, tokenParams, cookies);

                String accessTokenUrl = DS_DEFAULT_SERVICE_URL + DS_TOKEN_URL;
                tokenParams.put(DS_RESPONSE_TOKEN, tokenGenResponse.get(DS_RESPONSE_DATA).getAsString());
                JsonObject result = executeHttpRequest(accessTokenUrl, tokenParams, cookies);
                String token = result.get(DS_RESPONSE_DATA).getAsJsonObject().get(DS_RESPONSE_TOKEN).getAsString();
                DS_LOG.info("login and generate token success, token: {}", token);
                return token;
            }
            return null;
        } catch (Exception e) {
            DS_LOG.error("login and generate token fail: ", e);
            throw new DolphinScheduleException(String.format("login and generate token fail: %s", e.getMessage()));
        }
    }
This method just for DS testing, login by default admin username and password
generate a 1-day expiring token for test, the token will disappear with the DS container shutting down

@return the DS token
inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/dolphinscheduler/DolphinScheduleContainerTestEnv.java