use of org.datatransferproject.launcher.monitor.ConsoleMonitor in project data-transfer-project by google.
the class MicrosoftPhotosImporterTest method setUp.
@Before
public void setUp() throws IOException {
executor = new FakeIdempotentImportExecutor();
authData = mock(TokensAndUrlAuthData.class);
client = mock(OkHttpClient.class);
objectMapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
// mocked on a per test basis
jobStore = mock(TemporaryPerJobDataStore.class);
monitor = new ConsoleMonitor(ConsoleMonitor.Level.INFO);
credentialFactory = mock(MicrosoftCredentialFactory.class);
credential = new Credential.Builder(BearerToken.authorizationHeaderAccessMethod()).build();
when(credentialFactory.createCredential(any())).thenReturn(credential);
when(credentialFactory.refreshCredential(any())).thenReturn(credential);
credential.setAccessToken("acc");
credential.setExpirationTimeMilliseconds(null);
importer = new MicrosoftPhotosImporter(BASE_URL, client, objectMapper, jobStore, monitor, credentialFactory);
}
Aggregations