Skip to content

Commit

Permalink
Adapt ConsoleAppRestService with v2
Browse files Browse the repository at this point in the history
  • Loading branch information
mekya committed May 27, 2021
1 parent 6cd2ead commit ec744b9
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public class ConsoleAppRestServiceTest{

static {

ROOT_SERVICE_URL = "http://" + SERVER_ADDR + ":5080/rest";
ROOT_SERVICE_URL = "http://" + SERVER_ADDR + ":5080/rest/v2";

System.out.println("ROOT SERVICE URL: " + ROOT_SERVICE_URL);

Expand Down Expand Up @@ -2053,7 +2053,7 @@ public static boolean checkURLExist(String url) throws Exception {


public static Result callisFirstLogin() throws Exception {
String url = ROOT_SERVICE_URL + "/isFirstLogin";
String url = ROOT_SERVICE_URL + "/first-login-status";
HttpClient client = HttpClients.custom().setRedirectStrategy(new LaxRedirectStrategy()).build();
Gson gson = new Gson();
HttpUriRequest post = RequestBuilder.get().setUri(url).setHeader(HttpHeaders.CONTENT_TYPE, "application/json")
Expand All @@ -2075,7 +2075,7 @@ public static Result callisFirstLogin() throws Exception {

public static Result callCreateInitialUser(User user) throws Exception {

String url = ROOT_SERVICE_URL + "/addInitialUser";
String url = ROOT_SERVICE_URL + "/users/initial";
HttpClient client = HttpClients.custom().setRedirectStrategy(new LaxRedirectStrategy()).build();
Gson gson = new Gson();
HttpUriRequest post = RequestBuilder.post().setUri(url).setHeader(HttpHeaders.CONTENT_TYPE, "application/json")
Expand All @@ -2095,7 +2095,7 @@ public static Result callCreateInitialUser(User user) throws Exception {
}

private static Result callAuthenticateUser(User user) throws Exception {
String url = ROOT_SERVICE_URL + "/authenticateUser";
String url = ROOT_SERVICE_URL + "/users/authenticate";
HttpClient client = HttpClients.custom().setRedirectStrategy(new LaxRedirectStrategy())
.setDefaultCookieStore(httpCookieStore).build();
Gson gson = new Gson();
Expand All @@ -2116,7 +2116,8 @@ private static Result callAuthenticateUser(User user) throws Exception {
}

public static Result callSetAppSettings(String appName, AppSettings appSettingsModel) throws Exception {
String url = ROOT_SERVICE_URL + "/changeSettings/" + appName;

String url = ROOT_SERVICE_URL + "/admin/applications/settings/" + appName;
try (CloseableHttpClient client = HttpClients.custom().setRedirectStrategy(new LaxRedirectStrategy())
.setDefaultCookieStore(httpCookieStore).build())
{
Expand Down Expand Up @@ -2270,7 +2271,7 @@ public static Result callIsEnterpriseEdition() throws Exception {

public static AppSettings callGetAppSettings(String appName) throws Exception {

String url = ROOT_SERVICE_URL + "/getSettings/" + appName;
String url = ROOT_SERVICE_URL + "/applications/settings/" + appName;

HttpClient client = HttpClients.custom().setRedirectStrategy(new LaxRedirectStrategy())
.setDefaultCookieStore(httpCookieStore).build();
Expand Down

0 comments on commit ec744b9

Please sign in to comment.