RecomputeMailboxCountersRequestToTask extends TaskFromRequestRegistry.TaskRegistration { private static Options parseOptions(Request request) { Optional<String> stringValue = Optional.ofNullable(request.queryParams(TRUST_PARAM)); return parseOptions(stringValue); } @Inject  RecomputeMailboxCountersRequestToTask(RecomputeMailboxCountersService service);   }
@Test void parseOptionsShouldReturnRecheckWhenEmpty() { assertThat(RecomputeMailboxCountersRequestToTask.parseOptions(Optional.empty())) .isEqualTo(Options.recheckMessageProjection()); }
@Test void parseOptionsShouldReturnRecheckWhenFalse() { assertThat(RecomputeMailboxCountersRequestToTask.parseOptions(Optional.of("false"))) .isEqualTo(Options.recheckMessageProjection()); }
@Test void parseOptionsShouldNotBeSensitiveToCase() { assertThat(RecomputeMailboxCountersRequestToTask.parseOptions(Optional.of("False"))) .isEqualTo(Options.recheckMessageProjection()); }
@Test void parseOptionsShouldReturnTrueWhenTrust() { assertThat(RecomputeMailboxCountersRequestToTask.parseOptions(Optional.of("true"))) .isEqualTo(Options.trustMessageProjection()); }
@Test void parseOptionsShouldFailWhenEmpty() { assertThatThrownBy(() -> RecomputeMailboxCountersRequestToTask.parseOptions(Optional.of(""))) .isInstanceOf(IllegalArgumentException.class); }
@Test void parseOptionsShouldFailWhenNotAValidBoolean() { assertThatThrownBy(() -> RecomputeMailboxCountersRequestToTask.parseOptions(Optional.of("zz"))) .isInstanceOf(IllegalArgumentException.class); }