@Test public void testDebugLogCallsMadeForStartTransfer() throws Exception { PowerMockito .when( TransferListener.getInstance(null, null) ).thenReturn(mockTransferListener); PowerMockito .when( faspmanager2.startTransfer(anyString(), isNull(String.class), anyString(), any(TransferListener.class)) ).thenReturn(3L); when(mockLog.isDebugEnabled()).thenReturn(true); AsperaFaspManagerWrapper wrapper = new AsperaFaspManagerWrapper(new AsperaTransactionImpl(null, null, null, null, null, null)); wrapper.log = mockLog; long rtn = wrapper.startTransfer("xyz123", "configString1"); assertEquals(3L, rtn); verify(mockLog, times(1)).debug(Mockito.eq("Transfer Spec for Session with xferId [xyz123]")); }
public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonString( transferSpecStr, "token")); } log.trace("Calling method [startTransfer] with parameters [\"" + xferId + "\", null, transferSpecStr, transferListener]"); long rtn = faspmanager2.startTransfer(xferId, null, transferSpecStr, asperaTransaction.getTransferListener()); log.trace("Method [startTransfer] returned for xferId [\"" + xferId + "\"] with result: [" + rtn + "]"); return rtn; }
AsperaFaspManagerWrapper { public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonString( transferSpecStr, "token")); } log.trace("Calling method [startTransfer] with parameters [\"" + xferId + "\", null, transferSpecStr, transferListener]"); long rtn = faspmanager2.startTransfer(xferId, null, transferSpecStr, asperaTransaction.getTransferListener()); log.trace("Method [startTransfer] returned for xferId [\"" + xferId + "\"] with result: [" + rtn + "]"); return rtn; } }
AsperaFaspManagerWrapper { public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonString( transferSpecStr, "token")); } log.trace("Calling method [startTransfer] with parameters [\"" + xferId + "\", null, transferSpecStr, transferListener]"); long rtn = faspmanager2.startTransfer(xferId, null, transferSpecStr, asperaTransaction.getTransferListener()); log.trace("Method [startTransfer] returned for xferId [\"" + xferId + "\"] with result: [" + rtn + "]"); return rtn; } AsperaFaspManagerWrapper();  AsperaFaspManagerWrapper(AsperaTransaction asperaTransaction); }
AsperaFaspManagerWrapper { public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonString( transferSpecStr, "token")); } log.trace("Calling method [startTransfer] with parameters [\"" + xferId + "\", null, transferSpecStr, transferListener]"); long rtn = faspmanager2.startTransfer(xferId, null, transferSpecStr, asperaTransaction.getTransferListener()); log.trace("Method [startTransfer] returned for xferId [\"" + xferId + "\"] with result: [" + rtn + "]"); return rtn; } AsperaFaspManagerWrapper();  AsperaFaspManagerWrapper(AsperaTransaction asperaTransaction); long startTransfer(final String xferId, final String transferSpecStr); boolean pause(final String xferId); boolean resume(final String xferId); boolean cancel(final String xferId); boolean isRunning(final String xferId); boolean configureLogLocation(final String ascpLogPath); void setAsperaTransaction(AsperaTransaction asperaTransaction); }
AsperaFaspManagerWrapper { public long startTransfer(final String xferId, final String transferSpecStr) { log.info("Starting transfer with xferId [" + xferId + "]"); if (log.isDebugEnabled()) { log.debug("Transfer Spec for Session with xferId [" + xferId + "]"); log.debug(AsperaTransferManagerUtils.getRedactedJsonString( transferSpecStr, "token")); } log.trace("Calling method [startTransfer] with parameters [\"" + xferId + "\", null, transferSpecStr, transferListener]"); long rtn = faspmanager2.startTransfer(xferId, null, transferSpecStr, asperaTransaction.getTransferListener()); log.trace("Method [startTransfer] returned for xferId [\"" + xferId + "\"] with result: [" + rtn + "]"); return rtn; } AsperaFaspManagerWrapper();  AsperaFaspManagerWrapper(AsperaTransaction asperaTransaction); long startTransfer(final String xferId, final String transferSpecStr); boolean pause(final String xferId); boolean resume(final String xferId); boolean cancel(final String xferId); boolean isRunning(final String xferId); boolean configureLogLocation(final String ascpLogPath); void setAsperaTransaction(AsperaTransaction asperaTransaction);  }