api/src/test/java/edu/utexas/tacc/tapis/files/api/resources/ITestOpsRoutes.java
@Test(dataProvider = "testSystemsProvider")
    public void testRenameManyObjects2(TapisSystem testSystem) throws Exception {
        when(systemsCache.getSystem(any(), any(), any())).thenReturn(testSystem);

        addTestFilesToBucket(testSystem, "test1.txt", 10 * 1024);
        addTestFilesToBucket(testSystem, "test2.txt", 10 * 1024);
        addTestFilesToBucket(testSystem, "dir1/1.txt", 10 * 1024);
        addTestFilesToBucket(testSystem, "dir1/dir2/2.txt", 10 * 1024);
        addTestFilesToBucket(testSystem, "dir1/dir2/dir3/3.txt", 10 * 1024);
        addTestFilesToBucket(testSystem, "dir1/dir2/dir3/dir4.txt", 10 * 1024);

        MoveCopyRequest request = new MoveCopyRequest();
        request.setOperation(MoveCopyOperation.MOVE);
        request.setNewPath("renamed");

        FileStringResponse response = target("/v3/files/ops/testSystem/dir1/dir2/")
            .request()
            .accept(MediaType.APPLICATION_JSON)
            .header("x-tapis-token", getJwtForUser("dev", "testuser1"))
            .put(Entity.json(request), FileStringResponse.class);

        List<FileInfo> listing = doListing(testSystem.getId(), "dir1/1.txt", getJwtForUser("dev", "testuser1"));
        Assert.assertEquals(listing.size(), 1);
        listing = doListing(testSystem.getId(), "dir1/1.txt", getJwtForUser("dev", "testuser1"));
        Assert.assertEquals(listing.size(), 1);
        assertThrowsNotFoundForTestUser1("/dir1/dir2/");
    }
/**
     * Tests of objects deeper in the tree are renamed properly.
     *
     * @throws Exception
     */
Tests of objects deeper in the tree are renamed properly.
@throws Exception
Tests of objects deeper in the tree are renamed properly . @throws Exception
@Test(dataProvider = "testSystemsProvider")
    public void testRenameManyObjects2(TapisSystem testSystem) throws Exception {
        when(systemsCache.getSystem(any(), any(), any())).thenReturn(testSystem);
        addTestFilesToBucket(testSystem, "test1.txt", 10 * 1024);
        addTestFilesToBucket(testSystem, "test2.txt", 10 * 1024);
        addTestFilesToBucket(testSystem, "dir1/1.txt", 10 * 1024);
        addTestFilesToBucket(testSystem, "dir1/dir2/2.txt", 10 * 1024);
        addTestFilesToBucket(testSystem, "dir1/dir2/dir3/3.txt", 10 * 1024);
        addTestFilesToBucket(testSystem, "dir1/dir2/dir3/dir4.txt", 10 * 1024);
        MoveCopyRequest request = new MoveCopyRequest();
        request.setOperation(MoveCopyOperation.MOVE);
        request.setNewPath("renamed");
        FileStringResponse response = target("/v3/files/ops/testSystem/dir1/dir2/")
            .request()
            .accept(MediaType.APPLICATION_JSON)
            .header("x-tapis-token", getJwtForUser("dev", "testuser1"))
            .put(Entity.json(request), FileStringResponse.class);
        List<FileInfo> listing = doListing(testSystem.getId(), "dir1/1.txt", getJwtForUser("dev", "testuser1"));
        Assert.assertEquals(listing.size(), 1);
        listing = doListing(testSystem.getId(), "dir1/1.txt", getJwtForUser("dev", "testuser1"));
        Assert.assertEquals(listing.size(), 1);
        assertThrowsNotFoundForTestUser1("/dir1/dir2/");
    }
@ Test ( dataProvider = "testSystemsProvider" ) public void testRenameManyObjects2 ( TapisSystem testSystem ) throws Exception { when ( systemsCache . getSystem ( any ( ) , any ( ) , any ( ) ) ) . thenReturn ( testSystem ) ; addTestFilesToBucket ( testSystem , "test1.txt" , 10 * 1024 ) ; addTestFilesToBucket ( testSystem , "test2.txt" , 10 * 1024 ) ; addTestFilesToBucket ( testSystem , "dir1/1.txt" , 10 * 1024 ) ; addTestFilesToBucket ( testSystem , "dir1/dir2/2.txt" , 10 * 1024 ) ; addTestFilesToBucket ( testSystem , "dir1/dir2/dir3/3.txt" , 10 * 1024 ) ; addTestFilesToBucket ( testSystem , "dir1/dir2/dir3/dir4.txt" , 10 * 1024 ) ; MoveCopyRequest request = new MoveCopyRequest ( ) ; request . setOperation ( MoveCopyOperation . MOVE ) ; request . setNewPath ( "renamed" ) ; FileStringResponse response = target ( "/v3/files/ops/testSystem/dir1/dir2/" ) . request ( ) . accept ( MediaType . APPLICATION_JSON ) . header ( "x-tapis-token" , getJwtForUser ( "dev" , "testuser1" ) ) . put ( Entity . json ( request ) , FileStringResponse . class ) ; List < FileInfo > listing = doListing ( testSystem . getId ( ) , "dir1/1.txt" , getJwtForUser ( "dev" , "testuser1" ) ) ; Assert . assertEquals ( listing . size ( ) , 1 ) ; listing = doListing ( testSystem . getId ( ) , "dir1/1.txt" , getJwtForUser ( "dev" , "testuser1" ) ) ; Assert . assertEquals ( listing . size ( ) , 1 ) ; assertThrowsNotFoundForTestUser1 ( "/dir1/dir2/" ) ; }
Tests of objects deeper in the tree are renamed properly.
Tests of objects deeper in the tree are renamed properly .