Loading src/test/java/it/inaf/oats/vospace/CreateNodeControllerTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -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"); Loading src/test/resources/create-link-node-external-http.xml 0 → 100644 +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 Loading
src/test/java/it/inaf/oats/vospace/CreateNodeControllerTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -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"); Loading
src/test/resources/create-link-node-external-http.xml 0 → 100644 +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