use of ca.corefacility.bioinformatics.irida.service.impl.TestEmailController in project irida by phac-nml.
the class ExportUploadServiceTest method testUploadSubmissionBadCredentials.
@Test(expected = UploadException.class)
public void testUploadSubmissionBadCredentials() throws UploadException, IOException {
NcbiExportSubmission submission = createFakeSubmission();
String ftpHost = "localhost";
String ftpUser = "test";
String ftpPassword = "password";
String baseDirectory = "/home/test/submit/Test";
FakeFtpServer server = new FakeFtpServer();
// finds an open port
server.setServerControlPort(0);
ExportUploadService exportUploadService = new ExportUploadService(null, null, new TestEmailController());
try {
server.start();
int ftpPort = server.getServerControlPort();
exportUploadService.setConnectionDetails(ftpHost, ftpPort, ftpUser, ftpPassword, baseDirectory);
String xml = "<xml></xml>";
exportUploadService.uploadSubmission(submission, xml);
} finally {
server.stop();
}
}
Aggregations