Search in sources :

Example 1 with Status

use of org.datatransferproject.datatransfer.google.mediaModels.Status in project data-transfer-project by google.

the class GooglePhotosImporterTest method buildMediaItemResult.

private NewMediaItemResult buildMediaItemResult(String uploadToken, int code) {
    // We do a lot of mocking as building the actual objects would require changing the constructors
    // which messed up deserialization so best to leave them unchanged.
    GoogleMediaItem mediaItem = Mockito.mock(GoogleMediaItem.class);
    Mockito.when(mediaItem.getId()).thenReturn("newId");
    Status status = Mockito.mock(Status.class);
    Mockito.when(status.getCode()).thenReturn(code);
    NewMediaItemResult result = Mockito.mock(NewMediaItemResult.class);
    Mockito.when(result.getUploadToken()).thenReturn(uploadToken);
    Mockito.when(result.getStatus()).thenReturn(status);
    Mockito.when(result.getMediaItem()).thenReturn(mediaItem);
    return result;
}
Also used : Status(org.datatransferproject.datatransfer.google.mediaModels.Status) NewMediaItemResult(org.datatransferproject.datatransfer.google.mediaModels.NewMediaItemResult) GoogleMediaItem(org.datatransferproject.datatransfer.google.mediaModels.GoogleMediaItem)

Aggregations

GoogleMediaItem (org.datatransferproject.datatransfer.google.mediaModels.GoogleMediaItem)1 NewMediaItemResult (org.datatransferproject.datatransfer.google.mediaModels.NewMediaItemResult)1 Status (org.datatransferproject.datatransfer.google.mediaModels.Status)1