- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.github.robozonky.common.remote.Zonky.logout()
方法的一些代码示例,展示了Zonky.logout()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Zonky.logout()
方法的具体详情如下:
包路径:com.github.robozonky.common.remote.Zonky
类名称:Zonky
方法名:logout
暂无
代码示例来源:origin: RoboZonky/robozonky
@SuppressWarnings({"unchecked", "rawtypes"})
private ApiProvider mockFailingApi() {
final ApiProvider api = spy(new ApiProvider());
final ZonkyApiToken token = mock(ZonkyApiToken.class);
when(token.getAccessToken()).thenReturn(new char[0]);
final OAuth oauth = mock(OAuth.class);
when(oauth.login(any(), any())).thenReturn(token);
doAnswer(i -> {
final Function f = i.getArgument(0);
return f.apply(oauth);
}).when(api).oauth(any());
final Zonky z = mock(Zonky.class);
doAnswer(i -> {
final Consumer f = i.getArgument(0);
f.accept(z);
return null;
}).when(api).run(any(Consumer.class), any());
doThrow(IllegalStateException.class).when(z).logout(); // last call will fail
return api;
}
代码示例来源:origin: RoboZonky/robozonky
@Test
void closingNeverLoaded() {
final Zonky zonky = mock(Zonky.class);
final OAuth oAuth = mock(OAuth.class);
final ZonkyApiToken token = getTokenExpiringIn(Duration.ofSeconds(5));
when(oAuth.login(eq(OAuthScope.SCOPE_APP_WEB), eq(SECRETS.getUsername()), eq(SECRETS.getPassword())))
.thenAnswer(invocation -> token);
when(oAuth.refresh(any())).thenReturn(token);
final ApiProvider api = mockApi(oAuth, zonky);
final ZonkyApiTokenSupplier t = new ZonkyApiTokenSupplier(api, SECRETS);
t.close();
verify(oAuth, never()).login(any(), any(), any());
verify(zonky, never()).logout();
assertThatThrownBy(t::get).isInstanceOf(IllegalStateException.class);
}
代码示例来源:origin: RoboZonky/robozonky
@Test
void properLogin() {
// mock data
final ZonkyApiToken token = mock(ZonkyApiToken.class);
final OAuth oauth = mock(OAuth.class);
when(oauth.login(any(), any())).thenReturn(token);
final Zonky zonky = mock(Zonky.class);
final ApiProvider provider = mockApiProvider(oauth, token, zonky);
// execute SUT
final ZonkySettingsValidator validator = new ZonkySettingsValidator(() -> provider);
final InstallData d = ZonkySettingsValidatorTest.mockInstallData();
final DataValidator.Status result = validator.validateData(d);
// test
assertThat(result).isEqualTo(DataValidator.Status.OK);
verify(oauth)
.login(eq(ZonkySettingsValidatorTest.USERNAME),
eq(ZonkySettingsValidatorTest.PASSWORD.toCharArray()));
verify(zonky).logout();
}
代码示例来源:origin: RoboZonky/robozonky
@Test
void notClosingWhenExpired() {
final Zonky zonky = mock(Zonky.class);
final OAuth oAuth = mock(OAuth.class);
final ZonkyApiToken token = getTokenExpiringIn(Duration.ZERO);
when(oAuth.login(eq(OAuthScope.SCOPE_APP_WEB), eq(SECRETS.getUsername()), eq(SECRETS.getPassword())))
.thenAnswer(invocation -> token);
final ApiProvider api = mockApi(oAuth, zonky);
final ZonkyApiTokenSupplier t = new ZonkyApiTokenSupplier(api, SECRETS);
t.close();
verify(zonky, never()).logout();
}
}
代码示例来源:origin: RoboZonky/robozonky
@Test
void closingLoaded() {
final Zonky zonky = mock(Zonky.class);
final OAuth oAuth = mock(OAuth.class);
final ZonkyApiToken token = getTokenExpiringIn(Duration.ofSeconds(5));
when(oAuth.login(eq(OAuthScope.SCOPE_APP_WEB), eq(SECRETS.getUsername()), eq(SECRETS.getPassword())))
.thenAnswer(invocation -> token);
when(oAuth.refresh(any())).thenReturn(token);
final ApiProvider api = mockApi(oAuth, zonky);
final ZonkyApiTokenSupplier t = new ZonkyApiTokenSupplier(api, SECRETS);
t.get();
verify(oAuth).login(any(), any(), any());
assertThat(t.isClosed()).isFalse();
t.close();
verify(zonky, only()).logout();
assertThat(t.isClosed()).isTrue();
assertThatThrownBy(t::get).isInstanceOf(IllegalStateException.class);
}
代码示例来源:origin: RoboZonky/robozonky
@Test
void investAndlogout() {
final ControlApi control = mock(ControlApi.class);
final Api<ControlApi> ca = mockApi(control);
final PaginatedApi<RawLoan, LoanApi> la = mockApi();
final int loanId = 1;
final RawLoan loan = mock(RawLoan.class);
when(loan.getId()).thenReturn(loanId);
when(loan.getAmount()).thenReturn(200.0);
when(loan.getRemainingInvestment()).thenReturn(200.0);
when(la.execute(any())).thenReturn(loan);
final Zonky z = mockZonky(ca, la);
final Loan l = z.getLoan(loanId);
final Investment i = Investment.fresh(l, 200);
z.invest(i);
z.logout();
verify(control, times(1)).invest(any());
verify(control, times(1)).logout();
}
本文整理了Java中com.github.robozonky.cli.ZonkyPasswordFeature类的一些代码示例,展示了ZonkyPasswordFeature类的具体用法。这些代码示例
本文整理了Java中com.github.robozonky.cli.ZonkoidPasswordFeature类的一些代码示例,展示了ZonkoidPasswordFeature类的具体用法。这些
本文整理了Java中com.github.robozonky.common.remote.Zonky类的一些代码示例,展示了Zonky类的具体用法。这些代码示例主要来源于Github/Stackove
本文整理了Java中com.github.robozonky.integrations.zonkoid.ZonkoidConfirmationProvider类的一些代码示例,展示了ZonkoidCo
本文整理了Java中com.github.robozonky.app.tenant.ZonkyApiTokenSupplier类的一些代码示例,展示了ZonkyApiTokenSupplier类的具体
本文整理了Java中com.github.robozonky.api.remote.entities.ZonkyApiToken类的一些代码示例,展示了ZonkyApiToken类的具体用法。这些代码
本文整理了Java中com.github.robozonky.cli.ZonkyPasswordFeature.()方法的一些代码示例,展示了ZonkyPasswordFeature.()的具体用法。
本文整理了Java中com.github.robozonky.cli.ZonkyPasswordFeature.attemptLogin()方法的一些代码示例,展示了ZonkyPasswordFeat
本文整理了Java中com.github.robozonky.common.remote.Zonky.purchase()方法的一些代码示例,展示了Zonky.purchase()的具体用法。这些代码
本文整理了Java中com.github.robozonky.common.remote.Zonky.getDelinquentInvestments()方法的一些代码示例,展示了Zonky.getD
本文整理了Java中com.github.robozonky.common.remote.Zonky.sell()方法的一些代码示例,展示了Zonky.sell()的具体用法。这些代码示例主要来源于G
本文整理了Java中com.github.robozonky.common.remote.Zonky.getAvailableLoans()方法的一些代码示例,展示了Zonky.getAvailabl
本文整理了Java中com.github.robozonky.common.remote.Zonky.getBlockedAmounts()方法的一些代码示例,展示了Zonky.getBlockedA
本文整理了Java中com.github.robozonky.common.remote.Zonky.getInvestments()方法的一些代码示例,展示了Zonky.getInvestments
本文整理了Java中com.github.robozonky.common.remote.Zonky.downloadInvestmentsExport()方法的一些代码示例,展示了Zonky.dow
本文整理了Java中com.github.robozonky.common.remote.Zonky.getInvestment()方法的一些代码示例,展示了Zonky.getInvestment()
本文整理了Java中com.github.robozonky.common.remote.Zonky.invest()方法的一些代码示例,展示了Zonky.invest()的具体用法。这些代码示例主要
本文整理了Java中com.github.robozonky.common.remote.Zonky.logout()方法的一些代码示例,展示了Zonky.logout()的具体用法。这些代码示例主要
本文整理了Java中com.github.robozonky.common.remote.Zonky.getLoan()方法的一些代码示例,展示了Zonky.getLoan()的具体用法。这些代码示例
本文整理了Java中com.github.robozonky.common.remote.Zonky.getDevelopments()方法的一些代码示例,展示了Zonky.getDevelopmen
我是一名优秀的程序员,十分优秀!