ReporterConfigurationUtilTest.java 文件源码

java
阅读 19 收藏 0 点赞 0 评论 0

项目:Reporter 作者:
@Test
public void testUpdateConfigurationAllUpdate() throws Exception {
    whenNew(YamlConfiguration.class).withAnyArguments().thenReturn(mock(YamlConfiguration.class));
    when(configuration.isSet(anyString())).thenReturn(false);
    when(configuration.isSet("general.messaging.reportList")).thenReturn(true);
    when(configuration.isSet("general.messaging.broadcast")).thenReturn(true);
    when(configuration.isSet("general.locale")).thenReturn(true);
    when(configuration.isSet("general.localeAutoDownload")).thenReturn(true);
    when(configuration.isSet("general.checkForUpdates")).thenReturn(true);
    when(configuration.isSet("general.checkForDevUpdates")).thenReturn(true);
    when(configuration.isSet("locale.localeAutoDownload")).thenReturn(true);
    when(configuration.isSet("locale.keepLocaleBackupFile")).thenReturn(true);
    when(configuration.isSet("general.reporting.alerts.limitReached")).thenReturn(true);
    when(configuration.isSet("general.reporting.alerts.allowedToReportAgain")).thenReturn(true);

    when(configuration.options()).thenReturn(mock(FileConfigurationOptions.class));

    assertTrue(ReporterConfigurationUtil.updateConfiguration(configuration));
    verify(configuration, atLeastOnce()).set(anyString(), any(Object.class));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号