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;
}
Aggregations