diff --git a/README.md b/README.md
index f7e4bb8..cbc1cbe 100644
--- a/README.md
+++ b/README.md
@@ -14,16 +14,22 @@ Structure of the stack is following
├── bin
│ └── knotx // shell script used to resolve and run knotx instance
├── conf // contains application and logger configuration files
-│ ├── application.conf // defines all modules that Knot.x instance is running, provides configuration for Knot.x Core and global variables for other config files
+│ ├── application.conf // defines / includes all modules that Knot.x instance is running
│ ├── bootstrap.json // config retriever options, defines application configuration stores (e.g. points to `application.conf` - the main configuration)
│ ├── default-cluster.xml // basic configuration of Knot.x instance cluster
-│ ├── includes // additional modules configuration which are included in `application.conf`
-│ │ ├── actionKnot.conf
-│ │ ├── hbsKnot.conf
-│ │ ├── httpRepo.conf
-│ │ ├── server.conf
-│ │ ├── serviceAdapter.conf
-│ │ └── serviceKnot.conf
+│ ├── openapi.yaml // Open API 3.0 configuration that is loaded via Knot.x HTTP Server
+│ ├── server.conf // Knot.x HTTP server configuration which is included in `application.conf`
+│ ├── routes // server routes configurations
+│ │ ├── operation-get.conf
+│ │ └── handlers // handlers used in API operations definitions
+| │ │ ├── knotEngineHandler.conf
+| │ │ └── httpRepoConnectorHandler.conf
+│ ├── knots // Knot modules configurations which are included in `application.conf`
+│ │ ├── dataBridgeStack.conf
+│ │ ├── dataBridgeKnot.conf
+│ │ ├── dataBridgeSourceHttp.conf
+│ │ ├── templateEngineStack.conf
+│ │ └── templateEngineKnot.conf
│ └── logback.xml // logger configuration
├── knotx-stack.json // stack descriptor, defines instance libraries and dependencies
├── lib // contains instance libraries and dependencies, instance classpath
diff --git a/knotx-it-tests/pom.xml b/knotx-it-tests/pom.xml
index ada9ac8..4ff36a0 100644
--- a/knotx-it-tests/pom.xml
+++ b/knotx-it-tests/pom.xml
@@ -29,35 +29,48 @@
Knot.x - Integration Tests
-
+
io.knotx
- knotx-core
+ knotx-launcher
+
io.knotx
- knotx-databridge-api
+ knotx-server-http-core
io.knotx
- knotx-databridge-core
+ knotx-splitter-html
io.knotx
- knotx-databridge-adapter-http
+ knotx-assembler
+
+
+
+ io.knotx
+ knotx-repository-connector-http
io.knotx
- knotx-forms-api
+ knotx-repository-connector-fs
+
io.knotx
- knotx-forms-core
+ knotx-knot-engine-handler
+
io.knotx
- knotx-template-engine-api
+ knotx-databridge-core
+
+ io.knotx
+ knotx-databridge-adapter-http
+
+
io.knotx
knotx-template-engine-core
@@ -66,6 +79,8 @@
io.knotx
knotx-template-engine-handlebars
+
+
io.vertx
vertx-core
@@ -122,12 +137,6 @@
vertx-config
test
-
- io.knotx
- knotx-core
- test-jar
- test
-
@@ -144,6 +153,11 @@
8
+
+ -verbose
+ -Xlint:all
+ -parameters
+
diff --git a/knotx-it-tests/src/test/java/io/knotx/stack/it/KnotxServerTester.java b/knotx-it-tests/src/test/java/io/knotx/stack/it/KnotxServerTester.java
index a8a1786..99e2b24 100644
--- a/knotx-it-tests/src/test/java/io/knotx/stack/it/KnotxServerTester.java
+++ b/knotx-it-tests/src/test/java/io/knotx/stack/it/KnotxServerTester.java
@@ -29,9 +29,12 @@ final class KnotxServerTester {
this.serverPort = serverPort;
}
- static KnotxServerTester defatultInstance() {
- return new KnotxServerTester(KNOTX_TESTS_SERVER_ADDRESS_DEFAULT,
- KNOTX_TESTS_SERVER_PORT_DEFAULT);
+ static KnotxServerTester defaultInstance() {
+ return defaultInstance(KNOTX_TESTS_SERVER_PORT_DEFAULT);
+ }
+
+ static KnotxServerTester defaultInstance(int port) {
+ return new KnotxServerTester(KNOTX_TESTS_SERVER_ADDRESS_DEFAULT, port);
}
void testPostRequest(VertxTestContext context, Vertx vertx, String url,
diff --git a/knotx-it-tests/src/test/java/io/knotx/stack/it/SampleApplicationFallbackSupportIntegrationTest.java b/knotx-it-tests/src/test/java/io/knotx/stack/it/SampleApplicationFallbackSupportIntegrationTest.java
index afecc65..2466b35 100644
--- a/knotx-it-tests/src/test/java/io/knotx/stack/it/SampleApplicationFallbackSupportIntegrationTest.java
+++ b/knotx-it-tests/src/test/java/io/knotx/stack/it/SampleApplicationFallbackSupportIntegrationTest.java
@@ -8,7 +8,7 @@
import com.github.tomakehurst.wiremock.WireMockServer;
import io.knotx.junit5.KnotxApplyConfiguration;
import io.knotx.junit5.KnotxExtension;
-import io.knotx.junit5.wiremock.KnotxWiremock;
+import io.knotx.junit5.wiremock.ClasspathResourcesMockServer;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.vertx.junit5.VertxTestContext;
import io.vertx.reactivex.core.Vertx;
@@ -19,14 +19,15 @@
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.junit.jupiter.api.extension.ExtendWith;
+@Disabled("Fallbacks need to be reimplemented.")
@ExtendWith(KnotxExtension.class)
@TestInstance(Lifecycle.PER_CLASS)
-public class SampleApplicationFallbackSupportIntegrationTest {
+class SampleApplicationFallbackSupportIntegrationTest {
- @KnotxWiremock
+ @ClasspathResourcesMockServer
private WireMockServer mockService;
- @KnotxWiremock
+ @ClasspathResourcesMockServer
private WireMockServer mockRepository;
private KnotxServerTester knotxServerTester;
@@ -51,12 +52,12 @@ void initMocks() {
.withHeader("X-Server", "Knot.x")
));
- knotxServerTester = KnotxServerTester.defatultInstance();
+ knotxServerTester = KnotxServerTester.defaultInstance();
}
@Test
- @KnotxApplyConfiguration("conf/integrationTestsStack.conf")
- public void requestPageWhenFormsProcessingFails_expectServerError(
+ @KnotxApplyConfiguration("conf/application.conf")
+ void requestPageWhenFormsProcessingFails_expectServerError(
VertxTestContext context, Vertx vertx) {
knotxServerTester
.testGetServerError(context, vertx, "/content/local/notExistingFormsAdapter.html",
@@ -64,9 +65,9 @@ public void requestPageWhenFormsProcessingFails_expectServerError(
}
@Test
- @KnotxApplyConfiguration("conf/integrationTestsStack.conf")
+ @KnotxApplyConfiguration("conf/application.conf")
@Disabled("Bug in forms - when using undefined data adapter fallback is not applied")
- public void requestPageWhenFormsProcessingFailsAndFallbackDefined(
+ void requestPageWhenFormsProcessingFailsAndFallbackDefined(
VertxTestContext context, Vertx vertx) {
knotxServerTester
.testGetRequest(context, vertx, "/content/local/notExistingFormsAdapterWithFallback.html",
@@ -74,10 +75,10 @@ public void requestPageWhenFormsProcessingFailsAndFallbackDefined(
}
@Test
- @KnotxApplyConfiguration({"conf/integrationTestsStack.conf",
- "conf/overrides/defaultFallback.conf"})
+ @KnotxApplyConfiguration({"conf/application.conf",
+ "conf/overrides/defaultFallback.conf" })
@Disabled("Bug in forms - when using undefined data adapter fallback is not applied")
- public void requestPageWhenFormsProcessingFailsAndGlobalFallbackDefined(
+ void requestPageWhenFormsProcessingFailsAndGlobalFallbackDefined(
VertxTestContext context, Vertx vertx) {
knotxServerTester
.testGetRequest(context, vertx, "/content/local/notExistingFormsAdapter.html",
@@ -85,8 +86,8 @@ public void requestPageWhenFormsProcessingFailsAndGlobalFallbackDefined(
}
@Test
- @KnotxApplyConfiguration("conf/integrationTestsStack.conf")
- public void requestPageWhenDatabridgeProcessingFails_expectServerError(
+ @KnotxApplyConfiguration("conf/application.conf")
+ void requestPageWhenDatabridgeProcessingFails_expectServerError(
VertxTestContext context, Vertx vertx) {
knotxServerTester
.testGetServerError(context, vertx, "/content/local/notExistingDataDefinition.html",
@@ -94,8 +95,8 @@ public void requestPageWhenDatabridgeProcessingFails_expectServerError(
}
@Test
- @KnotxApplyConfiguration("conf/integrationTestsStack.conf")
- public void requestPageWhenDatabridgeProcessingFailsAndFallbackDefined(
+ @KnotxApplyConfiguration("conf/application.conf")
+ void requestPageWhenDatabridgeProcessingFailsAndFallbackDefined(
VertxTestContext context, Vertx vertx) {
knotxServerTester
.testGetRequest(context, vertx, "/content/local/notExistingDataDefinitionWithFallback.html",
@@ -103,9 +104,9 @@ public void requestPageWhenDatabridgeProcessingFailsAndFallbackDefined(
}
@Test
- @KnotxApplyConfiguration({"conf/integrationTestsStack.conf",
- "conf/overrides/defaultFallback.conf"})
- public void requestPageWhenDatabridgeProcessingFailsAndGlobalFallbackDefined(
+ @KnotxApplyConfiguration({"conf/application.conf",
+ "conf/overrides/defaultFallback.conf" })
+ void requestPageWhenDatabridgeProcessingFailsAndGlobalFallbackDefined(
VertxTestContext context, Vertx vertx) {
knotxServerTester
.testGetRequest(context, vertx, "/content/local/notExistingDataDefinition.html",
@@ -113,8 +114,8 @@ public void requestPageWhenDatabridgeProcessingFailsAndGlobalFallbackDefined(
}
@Test
- @KnotxApplyConfiguration("conf/integrationTestsStack.conf")
- public void requestPageWhenTemplateEngineProcessingFails_expectServerError(
+ @KnotxApplyConfiguration("conf/application.conf")
+ void requestPageWhenTemplateEngineProcessingFails_expectServerError(
VertxTestContext context, Vertx vertx) {
knotxServerTester
.testGetServerError(context, vertx, "/content/local/notExistingTemplateEngine.html",
@@ -122,8 +123,8 @@ public void requestPageWhenTemplateEngineProcessingFails_expectServerError(
}
@Test
- @KnotxApplyConfiguration("conf/integrationTestsStack.conf")
- public void requestPageWhenTemplateEngineProcessingFailsAndFallbackDefined(
+ @KnotxApplyConfiguration("conf/application.conf")
+ void requestPageWhenTemplateEngineProcessingFailsAndFallbackDefined(
VertxTestContext context, Vertx vertx) {
knotxServerTester
.testGetRequest(context, vertx, "/content/local/notExistingTemplateEngineWithFallback.html",
@@ -131,9 +132,9 @@ public void requestPageWhenTemplateEngineProcessingFailsAndFallbackDefined(
}
@Test
- @KnotxApplyConfiguration({"conf/integrationTestsStack.conf",
- "conf/overrides/defaultFallback.conf"})
- public void requestPageWhenTemplateEngineProcessingFailsAndGlobalFallbackDefined(
+ @KnotxApplyConfiguration({"conf/application.conf",
+ "conf/overrides/defaultFallback.conf" })
+ void requestPageWhenTemplateEngineProcessingFailsAndGlobalFallbackDefined(
VertxTestContext context, Vertx vertx) {
knotxServerTester
.testGetRequest(context, vertx, "/content/local/notExistingTemplateEngine.html",
diff --git a/knotx-it-tests/src/test/java/io/knotx/stack/it/SampleApplicationHeadersIntegrationTest.java b/knotx-it-tests/src/test/java/io/knotx/stack/it/SampleApplicationHeadersIntegrationTest.java
index 1af7ec1..f8da2e1 100644
--- a/knotx-it-tests/src/test/java/io/knotx/stack/it/SampleApplicationHeadersIntegrationTest.java
+++ b/knotx-it-tests/src/test/java/io/knotx/stack/it/SampleApplicationHeadersIntegrationTest.java
@@ -25,7 +25,8 @@
import com.github.tomakehurst.wiremock.WireMockServer;
import io.knotx.junit5.KnotxApplyConfiguration;
import io.knotx.junit5.KnotxExtension;
-import io.knotx.junit5.wiremock.KnotxWiremock;
+import io.knotx.junit5.RandomPort;
+import io.knotx.junit5.wiremock.ClasspathResourcesMockServer;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.vertx.junit5.VertxTestContext;
import io.vertx.reactivex.core.MultiMap;
@@ -35,20 +36,18 @@
import org.junit.jupiter.api.extension.ExtendWith;
@ExtendWith(KnotxExtension.class)
-public class SampleApplicationHeadersIntegrationTest {
+class SampleApplicationHeadersIntegrationTest {
private MultiMap expectedHeaders = MultiMap.caseInsensitiveMultiMap();
- @KnotxWiremock
- protected WireMockServer mockService;
+ @ClasspathResourcesMockServer
+ private WireMockServer mockService;
- @KnotxWiremock
- protected WireMockServer mockRepository;
-
- private KnotxServerTester knotxServerTester;
+ @ClasspathResourcesMockServer
+ private WireMockServer mockRepository;
@BeforeEach
- public void before() {
+ void before() {
stubForServer(mockService,
get(urlMatching("/service/mock/.*"))
.willReturn(
@@ -64,21 +63,20 @@ public void before() {
aResponse()
.withHeader("Cache-control", "no-cache, no-store, must-revalidate")
.withHeader("Content-Type", "text/html; charset=UTF-8")
- .withHeader("X-Server", "Knot.x")
+ .withHeader("X-Server", "Knot.x-Custom-Header")
));
expectedHeaders.clear();
expectedHeaders.add("Content-Type", "text/html; charset=UTF-8");
expectedHeaders.add("X-Server", "Knot.x-Custom-Header");
-
- knotxServerTester = KnotxServerTester.defatultInstance();
}
@Test
- @KnotxApplyConfiguration("conf/integrationTestsStack.conf")
- public void whenRequestingRemoteRepository_expectOnlyAllowedResponseHeaders(
- VertxTestContext context, Vertx vertx) {
- knotxServerTester.testGet(context, vertx, "/content/remote/fullPage.html", resp -> {
+ @KnotxApplyConfiguration("conf/application.conf")
+ void whenRequestingRemoteRepository_expectOnlyAllowedResponseHeaders(VertxTestContext context,
+ Vertx vertx, @RandomPort Integer globalServerPort) {
+ KnotxServerTester serverTester = KnotxServerTester.defaultInstance(globalServerPort);
+ serverTester.testGet(context, vertx, "/content/remote/fullPage.html", resp -> {
MultiMap headers = resp.headers();
expectedHeaders.names().forEach(name -> {
assertTrue(headers.contains(name), "Header " + name + " is expected to be present.");
diff --git a/knotx-it-tests/src/test/java/io/knotx/stack/it/SampleApplicationIntegrationTest.java b/knotx-it-tests/src/test/java/io/knotx/stack/it/SampleApplicationIntegrationTest.java
index e54d636..9fc72ab 100644
--- a/knotx-it-tests/src/test/java/io/knotx/stack/it/SampleApplicationIntegrationTest.java
+++ b/knotx-it-tests/src/test/java/io/knotx/stack/it/SampleApplicationIntegrationTest.java
@@ -21,20 +21,16 @@
import static io.knotx.junit5.wiremock.KnotxWiremockExtension.stubForServer;
import com.github.tomakehurst.wiremock.WireMockServer;
-import io.knotx.dataobjects.ClientResponse;
-import io.knotx.forms.api.FormsAdapterProxy;
-import io.knotx.forms.api.FormsAdapterResponse;
import io.knotx.junit5.KnotxApplyConfiguration;
import io.knotx.junit5.KnotxExtension;
-import io.knotx.junit5.wiremock.KnotxWiremock;
+import io.knotx.junit5.RandomPort;
+import io.knotx.junit5.wiremock.ClasspathResourcesMockServer;
import io.netty.handler.codec.http.HttpResponseStatus;
-import io.vertx.core.Future;
import io.vertx.core.json.JsonObject;
import io.vertx.junit5.VertxTestContext;
import io.vertx.reactivex.core.Vertx;
-import io.vertx.serviceproxy.ServiceBinder;
-import org.apache.commons.lang3.StringUtils;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
@@ -42,19 +38,17 @@
@ExtendWith(KnotxExtension.class)
@TestInstance(Lifecycle.PER_CLASS)
-public class SampleApplicationIntegrationTest {
+class SampleApplicationIntegrationTest {
- @KnotxWiremock
+ @ClasspathResourcesMockServer
private WireMockServer mockService;
- @KnotxWiremock
+ @ClasspathResourcesMockServer
private WireMockServer mockBrokenService;
- @KnotxWiremock
+ @ClasspathResourcesMockServer
private WireMockServer mockRepository;
- private KnotxServerTester knotxServerTester;
-
@BeforeAll
void initMocks() {
stubForServer(mockService,
@@ -81,63 +75,61 @@ void initMocks() {
.withHeader("Content-Type", "text/html; charset=UTF-8")
.withHeader("X-Server", "Knot.x")
));
-
- knotxServerTester = KnotxServerTester.defatultInstance();
}
@Test
- @KnotxApplyConfiguration("conf/integrationTestsStack.conf")
- public void requestFsRepoSimplePage(
- VertxTestContext context, Vertx vertx) {
- knotxServerTester.testGetRequest(context, vertx, "/content/local/fullPage.html",
+ @KnotxApplyConfiguration("conf/application.conf")
+ void requestFsRepoSimplePage(VertxTestContext context, Vertx vertx,
+ @RandomPort Integer globalServerPort) {
+ KnotxServerTester serverTester = KnotxServerTester.defaultInstance(globalServerPort);
+ serverTester.testGetRequest(context, vertx, "/content/local/fullPage.html",
"results/local-fullPage.html");
}
@Test
- @KnotxApplyConfiguration("conf/integrationTestsStack.conf")
- public void requestHttpRepoSimplePage(
- VertxTestContext context, Vertx vertx) {
- knotxServerTester.testGetRequest(context, vertx, "/content/remote/fullPage.html",
+ @KnotxApplyConfiguration("conf/application.conf")
+ void requestHttpRepoSimplePage(VertxTestContext context, Vertx vertx,
+ @RandomPort Integer globalServerPort) {
+ KnotxServerTester serverTester = KnotxServerTester.defaultInstance(globalServerPort);
+ serverTester.testGetRequest(context, vertx, "/content/remote/fullPage.html",
"results/remote-fullPage.html");
}
@Test
- @KnotxApplyConfiguration("conf/integrationTestsStack.conf")
- public void requestPageWithRequestParameters(
- VertxTestContext context, Vertx vertx) {
- knotxServerTester.testGetRequest(context, vertx,
+ @KnotxApplyConfiguration("conf/application.conf")
+ void requestPageWithRequestParameters(VertxTestContext context, Vertx vertx,
+ @RandomPort Integer globalServerPort) {
+ KnotxServerTester serverTester = KnotxServerTester.defaultInstance(globalServerPort);
+ serverTester.testGetRequest(context, vertx,
"/content/remote/fullPage.html?parameter%20with%20space=value&q=knotx",
"results/remote-fullPage.html");
}
@Test
- @KnotxApplyConfiguration("conf/integrationTestsStack.conf")
- public void requestPageWithServiceThatReturns500(
- VertxTestContext context, Vertx vertx) {
- knotxServerTester.testGetRequest(context, vertx, "/content/local/brokenService.html",
+ @KnotxApplyConfiguration("conf/application.conf")
+ void requestPageWithServiceThatReturns500(VertxTestContext context, Vertx vertx,
+ @RandomPort Integer globalServerPort) {
+ KnotxServerTester serverTester = KnotxServerTester.defaultInstance(globalServerPort);
+ serverTester.testGetRequest(context, vertx, "/content/local/brokenService.html",
"results/brokenService.html");
}
@Test
- @KnotxApplyConfiguration({"conf/integrationTestsStack.conf",
- "conf/overrides/customTagAndPrefix.conf"})
- public void requestPageWithCustomTagAndParamPrefix(
- VertxTestContext context, Vertx vertx) {
- knotxServerTester.testGetRequest(context, vertx, "/content/local/customSnippetTag.html",
- "results/customSnippetTag.html");
- }
-
- @Test
- @KnotxApplyConfiguration("conf/integrationTestsStack.conf")
- public void requestPageThatUseFormsDatabridgeAndTe(
- VertxTestContext context, Vertx vertx) {
- knotxServerTester.testGetRequest(context, vertx, "/content/local/formsBridgeTe.html",
+ @Disabled
+ @KnotxApplyConfiguration("conf/application.conf")
+ void requestPageThatUseFormsDatabridgeAndTe(VertxTestContext context, Vertx vertx,
+ @RandomPort Integer globalServerPort) {
+ KnotxServerTester serverTester = KnotxServerTester.defaultInstance(globalServerPort);
+ serverTester.testGetRequest(context, vertx, "/content/local/formsBridgeTe.html",
"results/formsBridgeTe.html");
}
@Test
- @KnotxApplyConfiguration("conf/integrationTestsStack.conf")
- public void submitOneFormAfterAnother(VertxTestContext context, Vertx vertx) {
+ @Disabled
+ @KnotxApplyConfiguration("conf/application.conf")
+ void submitOneFormAfterAnother(VertxTestContext context, Vertx vertx,
+ @RandomPort Integer globalServerPort) {
+ KnotxServerTester serverTester = KnotxServerTester.defaultInstance(globalServerPort);
final JsonObject competitionFormData = new JsonObject()
.put("name", "test")
.put("email", "email-1@example.com")
@@ -148,33 +140,33 @@ public void submitOneFormAfterAnother(VertxTestContext context, Vertx vertx) {
.put("_frmId", "newsletter");
mockFormsAdapter(vertx, competitionFormData, newsletterFormData);
- knotxServerTester.testPostRequest(context, vertx, "/content/local/formsBridgeTe.html",
+ serverTester.testPostRequest(context, vertx, "/content/local/formsBridgeTe.html",
competitionFormData.getMap(),
"results/submitCompetitionForm.html");
- knotxServerTester.testPostRequest(context, vertx, "/content/local/formsBridgeTe.html",
+ serverTester.testPostRequest(context, vertx, "/content/local/formsBridgeTe.html",
newsletterFormData.getMap(),
"results/submitNewsletterForm.html");
}
private void mockFormsAdapter(Vertx vertx, JsonObject competitionData,
JsonObject newsletterData) {
- ClientResponse clientResponse = new ClientResponse().setStatusCode(404);
- FormsAdapterResponse resp = new FormsAdapterResponse().setResponse(clientResponse);
-
- new ServiceBinder(vertx.getDelegate())
- .setAddress("knotx.forms.mock.adapter")
- .register(FormsAdapterProxy.class, (request, result) -> {
- String path = request.getParams().getString("testedFormId");
- if (StringUtils.isNotBlank(path)) {
- if (path.equals("competitionForm")) {
- clientResponse.setStatusCode(200)
- .setBody(new JsonObject().put("form", competitionData).toBuffer());
- } else if (path.equals("newsletterForm")) {
- clientResponse.setStatusCode(200)
- .setBody(new JsonObject().put("form", newsletterData).toBuffer());
- }
- }
- result.handle(Future.succeededFuture(resp));
- });
+// ClientResponse clientResponse = new ClientResponse().setStatusCode(404);
+// FormsAdapterResponse resp = new FormsAdapterResponse().setResponse(clientResponse);
+//
+// new ServiceBinder(vertx.getDelegate())
+// .setAddress("knotx.forms.mock.adapter")
+// .register(FormsAdapterProxy.class, (request, result) -> {
+// String path = request.getParams().getString("testedFormId");
+// if (StringUtils.isNotBlank(path)) {
+// if (path.equals("competitionForm")) {
+// clientResponse.setStatusCode(200)
+// .setBody(new JsonObject().put("form", competitionData).toBuffer());
+// } else if (path.equals("newsletterForm")) {
+// clientResponse.setStatusCode(200)
+// .setBody(new JsonObject().put("form", newsletterData).toBuffer());
+// }
+// }
+// result.handle(Future.succeededFuture(resp));
+// });
}
}
diff --git a/knotx-it-tests/src/test/resources/conf/application.conf b/knotx-it-tests/src/test/resources/conf/application.conf
new file mode 100644
index 0000000..bc31cba
--- /dev/null
+++ b/knotx-it-tests/src/test/resources/conf/application.conf
@@ -0,0 +1,12 @@
+########### Modules to start ###########
+# Modules array specify a list of verticles to be started by Knot.x.
+# Each line should have a form of =
+# where alias is just a name that you can use later in order to define configuration for the module
+# verticle-class-name is a fully qualified class name of the verticle.
+#
+# This array is filled in included files.
+modules = []
+
+include required(classpath("conf/server.conf"))
+include required(classpath("conf/knots/dataBridgeStack.conf"))
+include required(classpath("conf/knots/templateEngineStack.conf"))
diff --git a/knotx-it-tests/src/test/resources/conf/includes/forms.conf b/knotx-it-tests/src/test/resources/conf/includes/forms.conf
deleted file mode 100644
index ecafefb..0000000
--- a/knotx-it-tests/src/test/resources/conf/includes/forms.conf
+++ /dev/null
@@ -1,39 +0,0 @@
-# Event bus address of the Forms Knot
-address = ${global.forms.address}
-
-# Array of adapters that will be responsible for communicating with external services in order to
-# process client requests (form submisions).
-adapters = [
- {
- name = subscribe-competition
- address = ${global.forms.adapter.address}
- params.testedFormId = competitionForm
- allowedRequestHeaders = [
- "Cookie"
- ]
- allowedResponseHeaders = [
- "Set-Cookie",
- "Location"
- ]
- }
- {
- name = subscribe-newsletter
- address = ${global.forms.adapter.address}
- params.testedFormId = newsletterForm
- allowedRequestHeaders = [
- "Cookie"
- ]
- allowedResponseHeaders = [
- "Set-Cookie",
- "Location"
- ]
- }
-]
-
-# Name of the hidden input tag which is added by Action Knot.
-formIdentifierName = _frmId
-
-# Vert.x event bus delivery options used when communicating with other verticles
-# see http://vertx.io/docs/vertx-core/dataobjects.html#DeliveryOptions for the details what can be configured
-#
-# deliveryOptions {}
diff --git a/knotx-it-tests/src/test/resources/conf/includes/fsRepo.conf b/knotx-it-tests/src/test/resources/conf/includes/fsRepo.conf
deleted file mode 100644
index a091424..0000000
--- a/knotx-it-tests/src/test/resources/conf/includes/fsRepo.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-# Event bus address on which the HTTP repository connector listens on. Default is 'knotx.core.repository.filesystem'
-#
-address = ${global.repositories.fsRepo.address}
-
-# Set the root folder of the repository on file system.
-# If catalogue equals empty string a verticle will look for the files in classpath
-#
-catalogue = ""
diff --git a/knotx-it-tests/src/test/resources/conf/includes/server.conf b/knotx-it-tests/src/test/resources/conf/includes/server.conf
deleted file mode 100644
index 4d696ed..0000000
--- a/knotx-it-tests/src/test/resources/conf/includes/server.conf
+++ /dev/null
@@ -1,110 +0,0 @@
-# Configuraiton of HTTP server
-serverOptions {
- # Knot.x server HTTP port
- port = ${global.server.port}
-
- # If you want a server to serve SSL connections you can configure it here
- #
- # Enable SSL
- # ssl = true
- #
- # Path on the server the keystore.jks file is located
- # keyStoreOptions.path =
- #
- # Keystore password
- # keyStoreOptions.password =
-}
-
-routingSpecificationLocation = /openapi.yaml
-routingOperations = [
- {
- operationId = te-local-get
- handlers = ${global.server.routingOperations.handlers.request} [
- {
- name = repositoryHandler
- config.proxyAddress = ${global.repositories.fsRepo.address}
- },
- {
- name = splitterHandler
- config.proxyAddress = ${global.splitter.address}
- },
- {
- name = knotEngineHandler
- config.routing = {
- proxyAddress = ${global.forms.address},
- onTransition.next {
- address = ${global.bridge.address},
- onTransition.next {
- address = ${global.templateEngine.address}
- }
- }
- }
- },
- {
- name = assemblerHandler
- config.proxyAddress = ${global.assembler.address}
- }
- ] ${global.server.routingOperations.handlers.response}
- },
- {
- operationId = te-local-post
- handlers = ${global.server.routingOperations.handlers.request} [
- {
- name = repositoryHandler
- config.proxyAddress = ${global.repositories.fsRepo.address}
- },
- {
- name = splitterHandler
- config.proxyAddress = ${global.splitter.address}
- },
- {
- name = knotEngineHandler
- config.routing = {
- proxyAddress = ${global.forms.address},
- onTransition.next {
- address = ${global.bridge.address},
- onTransition.next {
- address = ${global.templateEngine.address}
- }
- }
- }
- },
- {
- name = assemblerHandler
- config.proxyAddress = ${global.assembler.address}
- }
- ] ${global.server.routingOperations.handlers.response}
- },
- {
- operationId = te-remote-get
- handlers = ${global.server.routingOperations.handlers.request} [
- {
- name = repositoryHandler
- config.proxyAddress = ${global.repositories.httpRepo.address}
- },
- {
- name = splitterHandler
- config.proxyAddress = ${global.splitter.address}
- },
- {
- name = knotEngineHandler
- config.routing = {
- proxyAddress = ${global.forms.address}
- onTransition.next {
- address = ${global.bridge.address}
- onTransition.next {
- address = ${global.templateEngine.address}
- }
- }
- }
- },
- {
- name = assemblerHandler
- config.proxyAddress = ${global.assembler.address}
- }
- ] ${global.server.routingOperations.handlers.response}
- }
-]
-
-displayExceptionDetails = true
-dropRequests = false
diff --git a/knotx-it-tests/src/test/resources/conf/integrationTestsStack.conf b/knotx-it-tests/src/test/resources/conf/integrationTestsStack.conf
deleted file mode 100644
index 6a8d6ab..0000000
--- a/knotx-it-tests/src/test/resources/conf/integrationTestsStack.conf
+++ /dev/null
@@ -1,179 +0,0 @@
-########### Modules to start ###########
-# You need to specify a list of verticle to be started by Knot.x
-# Each line should have a form of =
-# where alias is just a name that you can use later in order to define configuration for the module
-# verticle-class-name is a fully qualified class name of the verticle
-#
-# If you want to test the configuration you can simply comment out or remove unnecessary modules
-modules = [
- ########### Core ###########
- "server=io.knotx.server.KnotxServerVerticle"
- "httpRepo=io.knotx.repository.http.HttpRepositoryConnectorVerticle"
- "fsRepo=io.knotx.repository.fs.FilesystemRepositoryConnectorVerticle"
- "splitter=io.knotx.splitter.FragmentSplitterVerticle"
- "assembler=io.knotx.assembler.FragmentAssemblerVerticle"
- ########### Data Bridge ###########
- "dataBridge=io.knotx.databridge.core.DataBridgeKnot"
- "dataSourceHttp=io.knotx.databridge.http.HttpDataSourceAdapter"
- ########### Forms ###########
- "forms=io.knotx.forms.core.FormsKnot"
- # forms adapter is set as mock programmatically in the test
- ########### Template Engine ###########
- "templateEngine=io.knotx.te.core.TemplateEngineKnot"
-]
-
-########### Globals ###########
-global {
- server {
- port = 9092
- routingOperations.handlers {
- request = [
- {
- name = cookieHandler
- },
- {
- name = bodyHandler
- },
- {
- name = knotContextHandler
- }
- ],
- response = [
- {
- name = headerHandler
- # Statically defined HTTP response header returned to the client in every HTTP response
- config {
- name = X-Server
- value = Knot.x-Custom-Header
- }
- },
- {
- name = writerHandler
- # List of HTTP response headers Knot.x can return to the client
- config.allowedResponseHeaders = [
- "Access-Control-Allow-Origin",
- "Content-Type",
- "Content-Length"
- ]
- }
- ]
- }
- }
- snippetOptions {
- # Knot.x snippet HTML tag name. Default is 'script'.
- # Change here if you want to use different tag name, e.g. 'knotx:snippet'
- tagName = "knotx:snippet"
-
- # This prefix will start every snippet parameter in the snippet tag.
- # You may set it to 'data-xxxx-' when snippet tag name is an HTML tag to keep HTML5 data naming
- # compliance, e.g. when you set it to 'data-knotx-', snippet params will look like:
- #