aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-fe/src/test
diff options
context:
space:
mode:
authoraribeiro <anderson.ribeiro@est.tech>2019-12-17 10:23:13 +0000
committerOfir Sonsino <ofir.sonsino@intl.att.com>2019-12-18 13:26:17 +0000
commitf13ad6348df59f8883c9a3f86a7ef81ee4cb089c (patch)
tree52cca793d78d2d8f94a39f71cf6ea7053a0a5bd3 /catalog-fe/src/test
parent0ce779a2e1d9272ea3a0680b51ac032d6da8098a (diff)
Revert "Add Option to proxy to plugins"
This reverts commit ee4c4d72 Issue-ID: SDC-2648 Change-Id: I1f6cba80d3fb803530573c75f2fc54ca207e768a Signed-off-by: aribeiro <anderson.ribeiro@est.tech>
Diffstat (limited to 'catalog-fe/src/test')
-rw-r--r--catalog-fe/src/test/java/org/openecomp/sdc/servlets/FeProxyServletTest.java25
1 files changed, 3 insertions, 22 deletions
diff --git a/catalog-fe/src/test/java/org/openecomp/sdc/servlets/FeProxyServletTest.java b/catalog-fe/src/test/java/org/openecomp/sdc/servlets/FeProxyServletTest.java
index 81e939b929..4915936b1d 100644
--- a/catalog-fe/src/test/java/org/openecomp/sdc/servlets/FeProxyServletTest.java
+++ b/catalog-fe/src/test/java/org/openecomp/sdc/servlets/FeProxyServletTest.java
@@ -113,12 +113,7 @@ public class FeProxyServletTest {
when(plugin.getPluginId()).thenReturn("WORKFLOW");
when(plugin.getPluginSourceUrl()).thenReturn(WF_PROTOCOL + "://" + WF_HOST + ":" + WF_PORT);
when(plugin.getPluginDiscoveryUrl()).thenReturn(WF_PROTOCOL + "://" + WF_HOST + ":" + WF_PORT + "/workflows");
- when(plugin.getPluginFeProxyUrl()).thenReturn(WF_PROTOCOL + "://" + WF_HOST + ":" + WF_PORT + "/workflows/wf/");
- when(plugin.getPluginProxyRedirectPath()).thenReturn("/wf/");
pluginList.add(plugin);
- PluginsConfiguration.Plugin noConfigPlugin = new PluginsConfiguration.Plugin();
- noConfigPlugin.setPluginId("NO_CONFIG");
- pluginList.add(noConfigPlugin);
when(configurationManager.getPluginsConfiguration()).thenReturn(pluginsConfiguration);
when(pluginsConfiguration.getPluginsList()).thenReturn(pluginList);
@@ -187,31 +182,17 @@ public class FeProxyServletTest {
@Test
public void testRewriteURIWithWFAPIRequest() {
- when(servletRequest.getRequestURI()).thenReturn("/sdc1/feProxy/plugin/wf/workflows");
- String requestResourceUrl = "http://localhost:8080/sdc1/feProxy/plugin/wf/workflows";
- String expectedChangedUrl = WF_PROTOCOL + "://" + WF_HOST + ":" + WF_PORT + "/workflows/wf/workflows";
- when(servletRequest.getRequestURL()).thenReturn(new StringBuffer(requestResourceUrl));
-
- when(servletRequest.getContextPath()).thenReturn("/sdc1");
- when(servletRequest.getServletPath()).thenReturn("/feProxy/plugin/wf/workflows");
-
- String rewriteURI = feProxy.rewriteTarget(servletRequest);
-
- assertEquals(expectedChangedUrl, rewriteURI);
-
- // now test in case it did not go through the plugin
when(servletRequest.getRequestURI()).thenReturn("/sdc1/feProxy/wf/workflows");
- requestResourceUrl = "http://localhost:8080/sdc1/feProxy/wf/workflows";
- expectedChangedUrl = BE_PROTOCOL + "://" + BE_HOST + ":" + BE_PORT + "/sdc2/wf/workflows";
+ String requestResourceUrl = "http://localhost:8080/sdc1/feProxy/wf/workflows";
+ String expectedChangedUrl = WF_PROTOCOL + "://" + WF_HOST + ":" + WF_PORT + "/workflows/wf/workflows";
when(servletRequest.getRequestURL()).thenReturn(new StringBuffer(requestResourceUrl));
when(servletRequest.getContextPath()).thenReturn("/sdc1");
when(servletRequest.getServletPath()).thenReturn("/feProxy/wf/workflows");
- rewriteURI = feProxy.rewriteTarget(servletRequest);
+ String rewriteURI = feProxy.rewriteTarget(servletRequest);
assertEquals(expectedChangedUrl, rewriteURI);
-
}
/**