@Test public void isCondstoreEnableShouldBeFalseWhenNoSetting() { ImapConfiguration imapConfiguration = ImapConfiguration.builder().build(); assertThat(imapConfiguration.isCondstoreEnable()).isFalse(); }
@Test public void disabledCapsShouldReturnSetValue() { ImapConfiguration imapConfiguration = ImapConfiguration.builder() .disabledCaps(ImmutableSet.of("AnyValue")) .build(); assertThat(imapConfiguration.getDisabledCaps()).containsExactly("AnyValue"); }
@Test public void idleShouldBeDisable() { ImapConfiguration imapConfiguration = ImapConfiguration.builder() .enableIdle(false) .build(); assertThat(imapConfiguration.isEnableIdle()).isFalse(); }
public static Builder builder() { return new Builder(); }
@Test public void condstoreShouldBeDisableByDefault() throws Exception { system.configure(ImapConfiguration.builder().build()); simpleScriptedTestProtocol.run("CondstoreDisable"); }
@Test public void idleKeepAliveShouldThrowWhenNegative() { expectedException.expect(IllegalArgumentException.class); ImapConfiguration.builder() .idleTimeInterval(-1) .build(); }
@Test public void condstoreShouldBeEnableWhenGivenAndTrue() throws Exception { system.configure(ImapConfiguration.builder().isCondstoreEnable(true).build()); simpleScriptedTestProtocol.run("CondstoreEnable"); } }
@Test public void condstoreShouldBeSupportedWhenSelectedFor() { testee.configure(ImapConfiguration.builder().isCondstoreEnable(true).build()); Set<String> supportedCapabilities = testee.getSupportedCapabilities(null); assertThat(supportedCapabilities).contains(ImapConstants.SUPPORTS_CONDSTORE); }
@Test public void isCondstoreEnableShouldBeFalseWhenValueIsFalse() { ImapConfiguration imapConfiguration = ImapConfiguration.builder() .isCondstoreEnable(false) .build(); assertThat(imapConfiguration.isCondstoreEnable()).isFalse(); } }
@Test public void idleKeepAliveShouldReturnSetValue() { long idleValue = 1; ImapConfiguration imapConfiguration = ImapConfiguration.builder() .idleTimeInterval(idleValue) .build(); assertThat(imapConfiguration.getIdleTimeInterval()).isEqualTo(idleValue); }
@Test public void idleShouldEnableByDefault() { ImapConfiguration imapConfiguration = ImapConfiguration.builder() .build(); assertThat(imapConfiguration.isEnableIdle()).isTrue(); }
@Test public void millisecondsShouldBeDefaultValueWhenNoSetting() { ImapConfiguration imapConfiguration = ImapConfiguration.builder().build(); assertThat(imapConfiguration.getIdleTimeIntervalUnit()).isEqualTo(ImapConfiguration.DEFAULT_HEARTBEAT_INTERVAL_UNIT); }
@Test public void idleKeepAliveShouldBeDefaultValueWhenNoSetting() { ImapConfiguration imapConfiguration = ImapConfiguration.builder().build(); assertThat(imapConfiguration.getIdleTimeInterval()).isEqualTo(ImapConfiguration.DEFAULT_HEARTBEAT_INTERVAL_IN_SECONDS); }
@Test public void disabledCapsFromStringArrayShouldReturnMultipleSetValuesWithNormalizeValue() { ImapConfiguration imapConfiguration = ImapConfiguration.builder() .disabledCaps(" AnyValue ", " OtherValue ") .build(); assertThat(imapConfiguration.getDisabledCaps()).containsExactly("AnyValue", "OtherValue"); }
@Test public void disabledCapsShouldReturnMultipleSetValuesWithNormalizeValue() { ImapConfiguration imapConfiguration = ImapConfiguration.builder() .disabledCaps(ImmutableSet.of(" AnyValue ", " OtherValue ")) .build(); assertThat(imapConfiguration.getDisabledCaps()).containsExactly("AnyValue", "OtherValue"); }
@Test public void disabledCapsShouldReturnMultipleSetValues() { ImapConfiguration imapConfiguration = ImapConfiguration.builder() .disabledCaps(ImmutableSet.of("AnyValue", "OtherValue")) .build(); assertThat(imapConfiguration.getDisabledCaps()).containsExactly("AnyValue", "OtherValue"); }
@Test public void isCondstoreEnableShouldBeTrueWhenValueIsTrue() { ImapConfiguration imapConfiguration = ImapConfiguration.builder() .isCondstoreEnable(true) .build(); assertThat(imapConfiguration.isCondstoreEnable()).isTrue(); }
@Test public void condstoreShouldBeDisableWhenGivenAndFalse() throws Exception { system.configure(ImapConfiguration.builder().isCondstoreEnable(false).build()); simpleScriptedTestProtocol.run("CondstoreDisable"); }
@Test public void disabledCapShouldReturnMultipleStringWithNormalizeValue() { ImapConfiguration imapConfiguration = ImapConfiguration.builder() .disabledCap(" AnyValue ") .build(); assertThat(imapConfiguration.getDisabledCaps()).containsExactly("AnyValue"); }
@Test public void idleKeepAliveShouldThrowWhenRezo() { expectedException.expect(IllegalArgumentException.class); ImapConfiguration.builder() .idleTimeInterval(0L) .build(); }