ReloadDelegator extends BaseDelegator implements IReloadDelegator { @Override public String reload(final ReloadOptions opts) throws P4JavaException { List<Map<String, Object>> resultMaps = execMapCmdList( RELOAD, processParameters(opts, server), null); return parseCommandResultMapAsString(resultMaps); } ReloadDelegator(IOptionsServer server); @Override String reload(final ReloadOptions opts);  }
@Test public void testReloadShouldThrowsExceptionWhenInnerMethodCallThrowsIt() throws Exception { thrown.expect(P4JavaException.class); doThrow(P4JavaException.class).when(server).execMapCmdList(eq(RELOAD.toString()), eq(CMD_OPTIONS), eq((Map<String, Object>)null)); reloadDelegator.reload(opts); }
@Test public void testReloadShouldReturnNonBlankClientOrLabelOrTaskStreamName() throws Exception { resultMaps = buildReloadClientList(); when(server.execMapCmdList(eq(RELOAD.toString()), eq(CMD_OPTIONS), eq((Map<String, Object>)null))).thenReturn(resultMaps); String reloadClient = reloadDelegator.reload(opts); assertThat(reloadClient, is(CLIENT_NAME)); }
@Test public void testReloadShouldThrowsExceptionWhenInnerMethodCallThrowsIt() throws Exception { thrown.expect(P4JavaException.class); doThrow(P4JavaException.class).when(server).execMapCmdList(eq(RELOAD.toString()), eq(CMD_OPTIONS), eq(null)); reloadDelegator.reload(opts); }
@Test public void testReloadShouldReturnNonBlankClientOrLabelOrTaskStreamName() throws Exception { resultMaps = buildReloadClientList(); when(server.execMapCmdList(eq(RELOAD.toString()), eq(CMD_OPTIONS), eq(null))).thenReturn(resultMaps); String reloadClient = reloadDelegator.reload(opts); assertThat(reloadClient, is(CLIENT_NAME)); }