Commit 5f7829eb authored by Nicola Fulvio Calabria's avatar Nicola Fulvio Calabria
Browse files

Added LinkNode with http external target test

parent 2439a480
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -243,6 +243,25 @@ public class CreateNodeControllerTest {

    }
    
    @Test
    public void testCreateLinkNodeExternalHttp() throws Exception {
        String requestBody = getResourceFileContent("create-link-node-external-http.xml");

        when(nodeDao.listNode(eq("/")))
                .thenReturn(Optional.of(getContainerParentNode("/")));

        mockMvc.perform(put("/nodes/myExternalHttpLink")
                .header("Authorization", "Bearer user2_token")
                .content(requestBody)
                .contentType(MediaType.APPLICATION_XML)
                .accept(MediaType.APPLICATION_XML))
                .andDo(print())
                .andExpect(status().isOk());

        verifyLinkArguments("http://www.external.com/files/file.txt");

    }

    @Test
    public void testNodeAlreadyExisting() throws Exception {
        String requestBody = getResourceFileContent("create-unstructured-data-node.xml");
+11 −0
Original line number Diff line number Diff line
<vos:node xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:vos="http://www.ivoa.net/xml/VOSpace/v2.0" xsi:type="vos:LinkNode" uri="vos://example.com!vospace/myExternalHttpLink">
    <vos:properties>
        <vos:property uri="ivo://ivoa.net/vospace/core#description">test value</vos:property>        
    </vos:properties>
    <vos:target>http://www.external.com/files/file.txt</vos:target>
    <vos:accepts/>
    <vos:provides/>
    <vos:capabilities/>
</vos:node>
 No newline at end of file