use of org.apache.ftpserver.ftplet.FtpletResult in project ddf by codice.
the class FtpRequestHandlerTest method testOnRmdirStart.
@Test
public void testOnRmdirStart() throws FtpException, IOException {
FtpletResult result = ftplet.onRmdirStart(session, request);
assertEquals(FtpletResult.SKIP, result);
assertThat(getReplyCodes(), hasItem(250));
}
use of org.apache.ftpserver.ftplet.FtpletResult in project ddf by codice.
the class FtpRequestHandlerTest method testOnAppendStart.
@Test
public void testOnAppendStart() throws FtpException, IOException {
FtpletResult result = ftplet.onAppendStart(session, request);
assertEquals(FtpletResult.SKIP, result);
assertThat(getReplyCodes(), hasItem(250));
}
use of org.apache.ftpserver.ftplet.FtpletResult in project ddf by codice.
the class FtpRequestHandlerTest method testOnRenameStart.
@Test
public void testOnRenameStart() throws FtpException, IOException {
FtpFile ftpFile = mock(FtpFile.class);
when(ftpFile.getName()).thenReturn("test.txt");
when(session.getRenameFrom()).thenReturn(ftpFile);
FtpletResult result = ftplet.onRenameStart(session, request);
assertEquals(FtpletResult.SKIP, result);
assertThat(getReplyCodes(), hasItem(250));
}
use of org.apache.ftpserver.ftplet.FtpletResult in project ddf by codice.
the class FtpRequestHandlerTest method testFileIngestUniqueSuccess.
@Test
public void testFileIngestUniqueSuccess() throws FtpException, IOException, SourceUnavailableException, IngestException {
setupIngest();
FtpletResult result = ftplet.onUploadUniqueStart(session, request);
ArgumentCaptor<FtpReply> argumentCaptor = ArgumentCaptor.forClass(FtpReply.class);
verify(session, atLeast(1)).write(argumentCaptor.capture());
assertEquals(FtpletResult.SKIP, result);
List<String> strReplies = argumentCaptor.getAllValues().stream().map(FtpReply::getMessage).collect(Collectors.toList());
assertThat(strReplies, hasItem(containsString("Storing data with unique name: " + METACARD_ID)));
}
Aggregations