Skip to content
Snippets Groups Projects
Commit 526288d2 authored by Nicola Fulvio Calabria's avatar Nicola Fulvio Calabria
Browse files

Added LinkNode with http external target test

parent c667dd02
No related branches found
No related tags found
No related merge requests found
......@@ -242,6 +242,25 @@ public class CreateNodeControllerTest {
verifyLinkArguments(null);
}
@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 {
......
<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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment