@Test public void testGetOneDriveAPIInitializer() { OneDriveAPI api = provider.getAPIInitializer().apply("ACCESS_TOKEN"); assertNotNull(api); assertFalse(api.isBusinessConnection()); assertEquals("ACCESS_TOKEN", api.getAccessToken()); assertEquals("https: }
public Function<String, OneDriveAPI> getAPIInitializer() { Optional<String> businessResourceURL = getOneDriveForBusinessResource(); if (businessResourceURL.isPresent()) { return accessToken -> new OneDriveBusinessAPI(businessResourceURL.get(), accessToken); } return OneDriveBasicAPI::new; }
OneDriveOAuth2ServiceProvider extends AbstractLiveConnectOAuth2ServiceProvider { public Function<String, OneDriveAPI> getAPIInitializer() { Optional<String> businessResourceURL = getOneDriveForBusinessResource(); if (businessResourceURL.isPresent()) { return accessToken -> new OneDriveBusinessAPI(businessResourceURL.get(), accessToken); } return OneDriveBasicAPI::new; } }
OneDriveOAuth2ServiceProvider extends AbstractLiveConnectOAuth2ServiceProvider { public Function<String, OneDriveAPI> getAPIInitializer() { Optional<String> businessResourceURL = getOneDriveForBusinessResource(); if (businessResourceURL.isPresent()) { return accessToken -> new OneDriveBusinessAPI(businessResourceURL.get(), accessToken); } return OneDriveBasicAPI::new; }  }
OneDriveOAuth2ServiceProvider extends AbstractLiveConnectOAuth2ServiceProvider { public Function<String, OneDriveAPI> getAPIInitializer() { Optional<String> businessResourceURL = getOneDriveForBusinessResource(); if (businessResourceURL.isPresent()) { return accessToken -> new OneDriveBusinessAPI(businessResourceURL.get(), accessToken); } return OneDriveBasicAPI::new; }  Function<String, OneDriveAPI> getAPIInitializer(); @Override AuthorizationCodeFlow getAuthorizationCodeFlow(); }
OneDriveOAuth2ServiceProvider extends AbstractLiveConnectOAuth2ServiceProvider { public Function<String, OneDriveAPI> getAPIInitializer() { Optional<String> businessResourceURL = getOneDriveForBusinessResource(); if (businessResourceURL.isPresent()) { return accessToken -> new OneDriveBusinessAPI(businessResourceURL.get(), accessToken); } return OneDriveBasicAPI::new; }  Function<String, OneDriveAPI> getAPIInitializer(); @Override AuthorizationCodeFlow getAuthorizationCodeFlow();  }