Search in sources :

Example 1 with FtpReply

use of org.apache.ftpserver.ftplet.FtpReply 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)));
}
Also used : FtpletResult(org.apache.ftpserver.ftplet.FtpletResult) Matchers.containsString(org.hamcrest.Matchers.containsString) FtpReply(org.apache.ftpserver.ftplet.FtpReply) Test(org.junit.Test)

Aggregations

FtpReply (org.apache.ftpserver.ftplet.FtpReply)1 FtpletResult (org.apache.ftpserver.ftplet.FtpletResult)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 Test (org.junit.Test)1