### Question:
AsperaFaspManagerWrapper { public boolean cancel(final String xferId) { log.info("Cancel transfer with xferId [" + xferId + "]"); log.trace("Calling method [stopTransfer] with parameters [\"" + xferId + "\", 8, 0]"); boolean rtn = faspmanager2.stopTransfer(xferId); log.trace("Method [stopTransfer] 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);  }### Answer:
@Test public void testInfoLogCallsMadeForCancel() throws Exception { PowerMockito .when( TransferListener.getInstance(null, null) ).thenReturn(mockTransferListener); PowerMockito .when( faspmanager2.stopTransfer(anyString()) ).thenReturn(true); when(mockLog.isDebugEnabled()).thenReturn(false); AsperaFaspManagerWrapper wrapper = new AsperaFaspManagerWrapper(); wrapper.log = mockLog; boolean rtn = wrapper.cancel("xyz123"); assertTrue(rtn); verify(mockLog, times(1)).info(Mockito.eq("Cancel transfer with xferId [xyz123]")); }
@Test public void testTraceLogCallsMadeForCancel() throws Exception { PowerMockito .when( TransferListener.getInstance(null, null) ).thenReturn(mockTransferListener); PowerMockito .when( faspmanager2.stopTransfer(anyString()) ).thenReturn(true); when(mockLog.isDebugEnabled()).thenReturn(true); AsperaFaspManagerWrapper wrapper = new AsperaFaspManagerWrapper(); wrapper.log = mockLog; boolean rtn = wrapper.cancel("xyz123"); assertTrue(rtn); verify(mockLog, times(1)).trace(Mockito.eq("Calling method [stopTransfer] with parameters [\"xyz123\", 8, 0]")); verify(mockLog, times(1)).trace(Mockito.eq("Method [stopTransfer] returned for xferId [\"xyz123\"] with result: [true]")); }