UnloadDelegator extends BaseDelegator implements IUnloadDelegator { @Override public String unload(final UnloadOptions opts) throws P4JavaException { List<Map<String, Object>> resultMaps = execMapCmdList( UNLOAD, processParameters(opts, server), null); return parseCommandResultMapAsString(resultMaps); } UnloadDelegator(IOptionsServer server); @Override String unload(final UnloadOptions opts);  }
@Test public void shouldThrowsExceptionWhenInnerMethodCallThrowsIt() throws Exception { thrown.expect(P4JavaException.class); doThrow(P4JavaException.class).when(server).execMapCmdList( eq(UNLOAD.toString()), eq(CMD_OPTIONS), eq((Map<String, Object>)null)); unloadDelegator.unload(opts); }
@Test public void shouldThrowsExceptionWhenInnerMethodCallThrowsIt() throws Exception { thrown.expect(P4JavaException.class); doThrow(P4JavaException.class).when(server).execMapCmdList( eq(UNLOAD.toString()), eq(CMD_OPTIONS), eq(null)); unloadDelegator.unload(opts); }
@Test public void shouldReturnNonBlankUnloadItem() throws Exception { String unload = unloadDelegator.unload(opts); assertThat(unload, is(INFO_MESSAGE)); }