java-middle-tier/src/test/java/com/marklogic/pipes/ui/UIControllerTest.java
/**
   * Tests loading a graph. It 1st creates a graph then tries to load. In the end, it will delete it, too.
   *
   * @throws Exception
   */
Tests loading a graph. It 1st creates a graph then tries to load. In the end, it will delete it, too.
@throws Exception
Tests loading a graph . It 1st creates a graph then tries to load . In the end it will delete it too . @throws Exception
@Test
  void LoadGraph() throws Exception {
    try {
      createGraph();
      String request = "/v1/resources/vppBackendServices?rs:action=GetSavedGraph&rs:uri=/marklogic-pipes/savedGraph/test-save-graph.json";
      String response = "{\"models\":[], \"executionGraph\":{\"last_node_id\":2, \"last_link_id\":1, \"nodes\":[{\"id\":2, \"type\":\"dhf/output\", \"pos\":[1308, 434], \"size\":[180, 160], \"flags\":{}, \"order\":1, \"mode\":0, \"inputs\":[{\"name\":\"output\", \"type\":0, \"link\":1}], \"properties\":{}}, {\"id\":1, \"type\":\"dhf/input\", \"pos\":[248, 489], \"size\":[180, 60], \"flags\":{}, \"order\":0, \"mode\":0, \"outputs\":[{\"name\":\"input\", \"type\":\"\", \"links\":[1]}, {\"name\":\"uri\", \"type\":\"\", \"links\":null}, {\"name\":\"collections\", \"type\":\"\", \"links\":null}], \"properties\":{}}], \"links\":[[1, 1, 0, 2, 0, 0]], \"groups\":[], \"config\":{}, \"version\":0.4}, \"name\":\"test-save-graph\", \"metadata\":{\"title\":\"test-save-graph\", \"version\":\"00.01\", \"author\":\"\"}}";
      MockHttpServletRequestBuilder builder = MockMvcRequestBuilders.get(request).content(request)
        .session(session);
      this.mockMvc.perform(builder).andExpect(content().string(response));
    } finally {
      deleteGraph();
    }
  }
@ Test void LoadGraph ( ) throws Exception { try { createGraph ( ) ; String request = "/v1/resources/vppBackendServices?rs:action=GetSavedGraph&rs:uri=/marklogic-pipes/savedGraph/test-save-graph.json" ; String response = "{\"models\":[], \"executionGraph\":{\"last_node_id\":2, \"last_link_id\":1, \"nodes\":[{\"id\":2, \"type\":\"dhf/output\", \"pos\":[1308, 434], \"size\":[180, 160], \"flags\":{}, \"order\":1, \"mode\":0, \"inputs\":[{\"name\":\"output\", \"type\":0, \"link\":1}], \"properties\":{}}, {\"id\":1, \"type\":\"dhf/input\", \"pos\":[248, 489], \"size\":[180, 60], \"flags\":{}, \"order\":0, \"mode\":0, \"outputs\":[{\"name\":\"input\", \"type\":\"\", \"links\":[1]}, {\"name\":\"uri\", \"type\":\"\", \"links\":null}, {\"name\":\"collections\", \"type\":\"\", \"links\":null}], \"properties\":{}}], \"links\":[[1, 1, 0, 2, 0, 0]], \"groups\":[], \"config\":{}, \"version\":0.4}, \"name\":\"test-save-graph\", \"metadata\":{\"title\":\"test-save-graph\", \"version\":\"00.01\", \"author\":\"\"}}" ; MockHttpServletRequestBuilder builder = MockMvcRequestBuilders . get ( request ) . content ( request ) . session ( session ) ; this . mockMvc . perform ( builder ) . andExpect ( content ( ) . string ( response ) ) ; } finally { deleteGraph ( ) ; } }
Tests loading a graph.
Tests loading a graph .