Commit 5aba6ce0 authored by nfcalabria's avatar nfcalabria
Browse files

Fixed GetFileControllerTest

parent f16b2fe6
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -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);

@@ -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);

@@ -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));
@@ -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));
@@ -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);

@@ -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);

@@ -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"));