- // Make sure that our test endpoint is on the resource path
- // for Jersey Test.
- return new ResourceConfig(SearchServiceApiHarness.class);
+ /**
+ * Tests the dynamic shcema creation flow that send the request
+ * JSON to the data store without any JSON validation against a schema
+ *
+ * @throws IOException
+ */
+ @Test
+ public void createDynamicIndexTest() throws Exception {
+ String indexName = "super-ultra-dynamic-mega-index";
+ String dynamicUri = TOP_URI + "dynamic/";
+ File indexFile = new File(DYNAMIC_INDEX_PAYLOAD);
+ String indexPayload = TestUtils.readFileToString(indexFile);
+
+// String result = target(dynamicUri + indexName).request().put(Entity.json(indexPayload), String.class);
+ MvcResult result = this.mockMvc.perform ( put (dynamicUri + indexName)
+ .contentType ( MediaType.APPLICATION_JSON ).content ( indexPayload )).andReturn ();
+
+ assertEquals(indexPayload, result.getResponse ().getContentAsString ());