Loading src/test/java/it/inaf/ia2/transfer/controller/GetFileControllerTest.java +14 −7 Original line number Diff line number Diff line Loading @@ -71,7 +71,8 @@ public class GetFileControllerTest { public void getPublicFile() throws Exception { FileInfo fileInfo = new FileInfo(); fileInfo.setOsPath(tempFile.getAbsolutePath()); fileInfo.setActualBasePath("/"); fileInfo.setFsPath(tempFile.getAbsolutePath()); fileInfo.setVirtualPath("/path/to/myfile"); fileInfo.setPublic(true); Loading @@ -86,7 +87,8 @@ public class GetFileControllerTest { public void testContextPathIsRemoved() throws Exception { FileInfo fileInfo = new FileInfo(); fileInfo.setOsPath(tempFile.getAbsolutePath()); fileInfo.setActualBasePath("/"); fileInfo.setFsPath(tempFile.getAbsolutePath()); fileInfo.setVirtualPath("/path/to/myfile"); fileInfo.setPublic(true); Loading @@ -108,7 +110,8 @@ public class GetFileControllerTest { public void testFileNotFoundOnDisk() throws Exception { FileInfo fileInfo = new FileInfo(); fileInfo.setOsPath("/this/doesnt/exists"); fileInfo.setActualBasePath("/"); fileInfo.setFsPath("/this/doesnt/exist"); fileInfo.setPublic(true); when(fileDao.getFileInfo(any())).thenReturn(Optional.of(fileInfo)); Loading Loading @@ -153,7 +156,8 @@ public class GetFileControllerTest { FileInfo fileInfo = new FileInfo(); fileInfo.setVirtualPath("/path/to/myfile"); fileInfo.setOsPath(tempFile.getAbsolutePath()); fileInfo.setActualBasePath("/"); fileInfo.setFsPath(tempFile.getAbsolutePath()); fileInfo.setOwnerId("123"); when(fileDao.getFileInfo(any())).thenReturn(Optional.of(fileInfo)); Loading Loading @@ -181,7 +185,8 @@ public class GetFileControllerTest { public void testGetFileWithJobId() throws Exception { FileInfo fileInfo = new FileInfo(); fileInfo.setOsPath(tempFile.getAbsolutePath()); fileInfo.setActualBasePath("/"); fileInfo.setFsPath(tempFile.getAbsolutePath()); fileInfo.setVirtualPath("/path/to/myfile"); fileInfo.setPublic(true); Loading Loading @@ -216,7 +221,8 @@ public class GetFileControllerTest { unreadableFile.setReadable(false); FileInfo fileInfo = new FileInfo(); fileInfo.setOsPath(unreadableFile.getAbsolutePath()); fileInfo.setActualBasePath("/"); fileInfo.setFsPath(unreadableFile.getAbsolutePath()); fileInfo.setVirtualPath("/path/to/myfile"); fileInfo.setPublic(true); Loading Loading @@ -246,7 +252,8 @@ public class GetFileControllerTest { when(gmsClient.isMemberOf(any(), any())).thenReturn(true); FileInfo fileInfo = new FileInfo(); fileInfo.setOsPath(tempFile.getAbsolutePath()); fileInfo.setActualBasePath("/"); fileInfo.setFsPath(tempFile.getAbsolutePath()); fileInfo.setVirtualPath("/path/to/myfile"); fileInfo.setGroupRead(Collections.singletonList("group1")); Loading Loading
src/test/java/it/inaf/ia2/transfer/controller/GetFileControllerTest.java +14 −7 Original line number Diff line number Diff line Loading @@ -71,7 +71,8 @@ public class GetFileControllerTest { public void getPublicFile() throws Exception { FileInfo fileInfo = new FileInfo(); fileInfo.setOsPath(tempFile.getAbsolutePath()); fileInfo.setActualBasePath("/"); fileInfo.setFsPath(tempFile.getAbsolutePath()); fileInfo.setVirtualPath("/path/to/myfile"); fileInfo.setPublic(true); Loading @@ -86,7 +87,8 @@ public class GetFileControllerTest { public void testContextPathIsRemoved() throws Exception { FileInfo fileInfo = new FileInfo(); fileInfo.setOsPath(tempFile.getAbsolutePath()); fileInfo.setActualBasePath("/"); fileInfo.setFsPath(tempFile.getAbsolutePath()); fileInfo.setVirtualPath("/path/to/myfile"); fileInfo.setPublic(true); Loading @@ -108,7 +110,8 @@ public class GetFileControllerTest { public void testFileNotFoundOnDisk() throws Exception { FileInfo fileInfo = new FileInfo(); fileInfo.setOsPath("/this/doesnt/exists"); fileInfo.setActualBasePath("/"); fileInfo.setFsPath("/this/doesnt/exist"); fileInfo.setPublic(true); when(fileDao.getFileInfo(any())).thenReturn(Optional.of(fileInfo)); Loading Loading @@ -153,7 +156,8 @@ public class GetFileControllerTest { FileInfo fileInfo = new FileInfo(); fileInfo.setVirtualPath("/path/to/myfile"); fileInfo.setOsPath(tempFile.getAbsolutePath()); fileInfo.setActualBasePath("/"); fileInfo.setFsPath(tempFile.getAbsolutePath()); fileInfo.setOwnerId("123"); when(fileDao.getFileInfo(any())).thenReturn(Optional.of(fileInfo)); Loading Loading @@ -181,7 +185,8 @@ public class GetFileControllerTest { public void testGetFileWithJobId() throws Exception { FileInfo fileInfo = new FileInfo(); fileInfo.setOsPath(tempFile.getAbsolutePath()); fileInfo.setActualBasePath("/"); fileInfo.setFsPath(tempFile.getAbsolutePath()); fileInfo.setVirtualPath("/path/to/myfile"); fileInfo.setPublic(true); Loading Loading @@ -216,7 +221,8 @@ public class GetFileControllerTest { unreadableFile.setReadable(false); FileInfo fileInfo = new FileInfo(); fileInfo.setOsPath(unreadableFile.getAbsolutePath()); fileInfo.setActualBasePath("/"); fileInfo.setFsPath(unreadableFile.getAbsolutePath()); fileInfo.setVirtualPath("/path/to/myfile"); fileInfo.setPublic(true); Loading Loading @@ -246,7 +252,8 @@ public class GetFileControllerTest { when(gmsClient.isMemberOf(any(), any())).thenReturn(true); FileInfo fileInfo = new FileInfo(); fileInfo.setOsPath(tempFile.getAbsolutePath()); fileInfo.setActualBasePath("/"); fileInfo.setFsPath(tempFile.getAbsolutePath()); fileInfo.setVirtualPath("/path/to/myfile"); fileInfo.setGroupRead(Collections.singletonList("group1")); Loading