DuplicateDelegator extends BaseDelegator implements IDuplicateDelegator { @Override public List<IFileSpec> duplicateRevisions( final IFileSpec fromFile, final IFileSpec toFile, final DuplicateRevisionsOptions opts) throws P4JavaException { List<Map<String, Object>> resultMaps = execMapCmdList( DUPLICATE, processParameters( opts, fromFile, toFile, null, server), null); return buildNonNullObjectListFromCommandResultMaps( resultMaps, rethrowFunction( new FunctionWithException<Map, IFileSpec>() { @Override public IFileSpec apply(Map map) throws P4JavaException { return ResultListBuilder.handleIntegrationFileReturn( map, server); } } )); } DuplicateDelegator(IOptionsServer server); @Override List<IFileSpec> duplicateRevisions(
            final IFileSpec fromFile,
            final IFileSpec toFile,
            final DuplicateRevisionsOptions opts);  }
@Test public void testDuplicateRevisions() throws Exception { when(server.execMapCmdList( eq(DUPLICATE.toString()), any(String[].class), eq((Map<String, Object>)null))).thenReturn(resultMaps); List<IFileSpec> fileSpecs = duplicateDelegator.duplicateRevisions( mock(IFileSpec.class), mock(IFileSpec.class), mock(DuplicateRevisionsOptions.class)); assertThat(fileSpecs.size(), is(1)); }
@Test public void testDuplicateRevisions() throws Exception { when(server.execMapCmdList( eq(DUPLICATE.toString()), any(String[].class), eq(null))).thenReturn(resultMaps); List<IFileSpec> fileSpecs = duplicateDelegator.duplicateRevisions( mock(IFileSpec.class), mock(IFileSpec.class), mock(DuplicateRevisionsOptions.class)); assertThat(fileSpecs.size(), is(1)); }