[ResetDB] Remove DV related stuff
*/
package io.syndesis.server.endpoint.v1.handler.tests;
-import java.io.IOException;
-import java.sql.DatabaseMetaData;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-
-import io.fabric8.openshift.api.model.DeploymentConfig;
import io.syndesis.common.model.ListResult;
import io.syndesis.common.model.ModelData;
import io.syndesis.common.model.WithId;
@@ -41,14 +23,30 @@ import io.syndesis.common.util.cache.CacheManager;
import io.syndesis.server.dao.manager.DataAccessObject;
import io.syndesis.server.dao.manager.DataManager;
import io.syndesis.server.openshift.OpenShiftService;
-import okhttp3.OkHttpClient;
-import okhttp3.Request;
import org.skife.jdbi.v2.DBI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+
+import java.sql.DatabaseMetaData;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import io.fabric8.openshift.api.model.DeploymentConfig;
+
@Path("/test-support")
@org.springframework.stereotype.Component
@ConditionalOnProperty(value = "endpoints.test_support.enabled")
@@ -89,7 +87,6 @@ public class TestSupportHandler {
deleteAllDBEntities();
startControllers();
dataMgr.resetDeploymentData();
- resetDv();
LOG.warn("user {} reset the DB", user);
}
@@ -136,18 +133,6 @@ public class TestSupportHandler {
cacheManager.evictAll();
}
- private static void resetDv() {
- final OkHttpClient httpClient = new OkHttpClient();
- try (okhttp3.Response dvResponse = httpClient.newCall(new Request.Builder().get().url("http://syndesis-dv/dv/v1/test-support/reset-db").build()).execute()) {
- if (!dvResponse.isSuccessful()) {
- LOG.info("cannot reset dv - code {}", dvResponse.code());
- }
- } catch (IOException e) {
- //more than likely it's not enabled
- LOG.info("cannot reset dv", e);
- }
- }
-
private void startControllers() {
controllers.forEach(BackendController::start);
}
