use of com.axway.ats.action.filetransfer.FileTransferConfigurator in project ats-framework by Axway.
the class Test_GenericTransferClient method testConnectUsingCustomClient.
@Test(expected = AssertionError.class)
public void testConnectUsingCustomClient() throws Exception {
String customFileTransferClientName = "SomeCustomClientClass";
mockStatic(FileTransferConfigurator.class);
FileTransferConfigurator mockFileTransferConfigurator = createMock(FileTransferConfigurator.class);
expect(FileTransferConfigurator.getInstance()).andReturn(mockFileTransferConfigurator);
expect(mockFileTransferConfigurator.getFileTransferClient(TransferProtocol.HTTP_CUSTOM)).andReturn(customFileTransferClientName);
IFileTransferClient basicClient = createMock(IFileTransferClient.class);
mockStatic(ClientFactory.class);
expect(ClientFactory.getInstance()).andReturn(factoryMock);
expect(factoryMock.getClient(TransferProtocol.HTTP_CUSTOM, TransferProtocol.HTTP_CUSTOM.getDefaultPort(), customFileTransferClientName)).andReturn(basicClient);
basicClient.connect(SAMPLE_HOST_NAME, SAMPLE_USER_NAME, SAMPLE_PASSWORD);
replayAll();
mockedTestObject = new FileTransferClient(TransferProtocol.HTTP_CUSTOM);
mockedTestObject.connect(SAMPLE_HOST_NAME, SAMPLE_USER_NAME, SAMPLE_PASSWORD);
verifyAll();
}
Aggregations