mirror of https://github.com/apache/nifi.git
NIFI-11049 Fixed flaky PutDropboxTest, attribute description corrected
This closes #6850. Signed-off-by: Peter Turcsanyi <turcsanyi@apache.org>
This commit is contained in:
parent
b107ae1f8c
commit
b7071cbb04
|
@ -30,11 +30,11 @@ public class DropboxAttributes {
|
|||
public static final String SIZE_DESC = "The size of the file";
|
||||
|
||||
public static final String TIMESTAMP = "dropbox.timestamp";
|
||||
public static final String TIMESTAMP_DESC = "The server modified time, when the file was uploaded to Dropbox";
|
||||
public static final String TIMESTAMP_DESC = "The server modified time of the file";
|
||||
|
||||
public static final String REVISION = "dropbox.revision";
|
||||
public static final String REVISION_DESC = "Revision of the file";
|
||||
|
||||
public static final String ERROR_MESSAGE = "error.message";
|
||||
public static final String ERROR_MESSAGE_DESC = "The error message returned by Dropbox when the fetch of a file fails";
|
||||
public static final String ERROR_MESSAGE_DESC = "The error message returned by Dropbox";
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
|
|||
import static org.apache.nifi.processors.dropbox.DropboxAttributes.ERROR_MESSAGE;
|
||||
import static org.mockito.Answers.RETURNS_DEEP_STUBS;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyLong;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
@ -44,7 +45,6 @@ import com.dropbox.core.v2.files.UploadWriteFailed;
|
|||
import com.dropbox.core.v2.files.WriteError;
|
||||
import com.dropbox.core.v2.files.WriteMode;
|
||||
import java.io.InputStream;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -255,18 +255,12 @@ public class PutDropboxTest extends AbstractDropboxTest {
|
|||
.thenReturn(mockUploadSessionAppendV2Uploader);
|
||||
|
||||
//finish session: 30 - 8 - 2 * 8 = 6 bytes uploaded
|
||||
CommitInfo commitInfo = CommitInfo.newBuilder(getPath(TEST_FOLDER , FILENAME_1))
|
||||
.withMode(WriteMode.ADD)
|
||||
.withStrictConflict(true)
|
||||
.withClientModified(new Date(mockFlowFile.getEntryDate()))
|
||||
.build();
|
||||
|
||||
when(mockDbxUserFilesRequest
|
||||
.uploadSessionFinish(any(UploadSessionCursor.class), eq(commitInfo)))
|
||||
.uploadSessionFinish(any(UploadSessionCursor.class), any(CommitInfo.class)))
|
||||
.thenReturn(mockUploadSessionFinishUploader);
|
||||
|
||||
when(mockUploadSessionFinishUploader
|
||||
.uploadAndFinish(any(InputStream.class), eq(6L)))
|
||||
.uploadAndFinish(any(InputStream.class), anyLong()))
|
||||
.thenReturn(createFileMetadata(FILE_ID_1, FILENAME_1, TEST_FOLDER, CREATED_TIME));
|
||||
|
||||
testRunner.enqueue(mockFlowFile);
|
||||
|
|
Loading…
Reference in New Issue