@Test public void fileNotCopied() throws Exception { entry.source_filefolder = new String[] { EMPTY }; entry.destination_filefolder = new String[] { EMPTY }; entry.wildcard = new String[] { EMPTY }; entry.execute( new Result(), 0 ); verify( entry, never() ).processFileFolder( anyString(), anyString(), anyString(), any( Job.class ), any( Result.class ) ); }
@Test public void filesCopied() throws Exception { String[] srcPath = new String[] { "path1", "path2", "path3" }; String[] destPath = new String[] { "dest1", "dest2", "dest3" }; entry.source_filefolder = srcPath; entry.destination_filefolder = destPath; entry.wildcard = new String[] { EMPTY, EMPTY, EMPTY }; Result result = entry.execute( new Result(), 0 ); verify( entry, times( srcPath.length ) ).processFileFolder( anyString(), anyString(), anyString(), any( Job.class ), any( Result.class ) ); assertFalse( result.getResult() ); assertEquals( 3, result.getNrErrors() ); }
@Test public void fileCopied() throws Exception { String srcPath = "path/to/file"; String destPath = "path/to/dir"; entry.source_filefolder = new String[] { srcPath }; entry.destination_filefolder = new String[] { destPath }; entry.wildcard = new String[] { EMPTY }; Result result = entry.execute( new Result(), 0 ); verify( entry ).processFileFolder( anyString(), anyString(), anyString(), any( Job.class ), any( Result.class ) ); verify( entry, atLeast( 1 ) ).preprocessfilefilder( any( String[].class ) ); assertFalse( result.getResult() ); assertEquals( 1, result.getNrErrors() ); verify( mockNamedClusterEmbedManager ).passEmbeddedMetastoreKey( anyObject(), anyString() ); }