Refine search
@Test public void get_return_to_is_empty_when_no_cookie() { when(request.getCookies()).thenReturn(new Cookie[] {}); Optional<String> redirection = underTest.getReturnTo(request); assertThat(redirection).isEmpty(); }
@Test public void testGetInfoForUnknownQuery() { mockErrorHttpResponse(HttpStatus.GONE); Optional<QueryStats> infoForQuery = queryStatsClient.getQueryStats("20150505_160116_00005_sdzex"); assertThat(infoForQuery).isEmpty(); }
@Test public void findByKey_returns_absent_if_rule_does_not_exist_in_DB() { Optional<Rule> rule = underTest.findByKey(AC_RULE_KEY); assertThat(rule).isEmpty(); }
private void assertThatRuleIsNotPresent(QProfileDto profile, RuleDefinitionDto rule) { Optional<OrgActiveRuleDto> activeRule = db.getDbClient().activeRuleDao().selectByProfile(db.getSession(), profile) .stream() .filter(ar -> ar.getRuleKey().equals(rule.getKey())) .findFirst(); assertThat(activeRule).isEmpty(); }
@Test public void get_return_to_is_empty_when_no_value() { when(request.getCookies()).thenReturn(new Cookie[] {new Cookie(AUTHENTICATION_COOKIE_NAME, "{}")}); Optional<String> redirection = underTest.getReturnTo(request); assertThat(redirection).isEmpty(); }
@Test public void get_allowEmailShift_is_empty_when_no_value() { when(request.getCookies()).thenReturn(new Cookie[] {new Cookie(AUTHENTICATION_COOKIE_NAME, "{}")}); Optional<Boolean> allowEmailShift = underTest.getAllowEmailShift(request); assertThat(allowEmailShift).isEmpty(); }
@Test public void findByKey_returns_empty_if_argument_is_deprecated_key_in_DB_of_rule_in_DB() { Optional<Rule> rule = underTest.findByKey(DEPRECATED_KEY_OF_NON_EXITING_RULE); assertThat(rule).isEmpty(); }
@Test public void get_allowEmailShift_is_empty_when_no_cookie() { when(request.getCookies()).thenReturn(new Cookie[] {}); Optional<Boolean> allowEmailShift = underTest.getAllowEmailShift(request); assertThat(allowEmailShift).isEmpty(); }
@Test public void header_is_empty_if_absent_from_request() { when(source.getHeader("Accept")).thenReturn(null); assertThat(underTest.header("Accept")).isEmpty(); }
@Test public void findById_returns_absent_if_rule_does_not_exist_in_DB() { Optional<Rule> rule = underTest.findById(AC_RULE_ID); assertThat(rule).isEmpty(); }
@Test public void getAllowUpdateLogin_is_empty_when_no_cookie() { when(request.getCookies()).thenReturn(new Cookie[] {}); Optional<Boolean> allowLoginUpdate = underTest.getAllowUpdateLogin(request); assertThat(allowLoginUpdate).isEmpty(); }
@Test public void getLocalInetAddress_returns_empty_if_no_local_addresses_match() { Optional<InetAddress> address = underTest.getLocalInetAddress(a -> false); assertThat(address).isEmpty(); }
@Test public void getAllowUpdateLogin_is_empty_when_no_value() { when(request.getCookies()).thenReturn(new Cookie[] {new Cookie(AUTHENTICATION_COOKIE_NAME, "{}")}); Optional<Boolean> allowLoginUpdate = underTest.getAllowUpdateLogin(request); assertThat(allowLoginUpdate).isEmpty(); }
@Test public void test_call_with_unknown_member() { assertThat(underTest.getAnswer(member)).isEmpty(); assertThat(underTest.hasTimedOut(member)).isFalse(); assertThat(underTest.getFailed(member)).isEmpty(); }
@Test public void empty_query() { assertThat(underTest.getMetricCriteria()).isEmpty(); assertThat(underTest.getQualityGateStatus()).isEmpty(); assertThat(underTest.getOrganizationUuid()).isEmpty(); }
@Test public void getCeWorkerIn_returns_empty_if_worker_registered_in_CeWorkerController_but_has_no_current_thread() { CeWorker ceWorker = mock(CeWorker.class); Thread currentThread = Thread.currentThread(); Thread otherThread = new Thread(); underTest.registerProcessingFor(ceWorker); mockWorkerIsRunningOnNoThread(ceWorker); assertThat(underTest.getCeWorkerIn(currentThread)).isEmpty(); assertThat(underTest.getCeWorkerIn(otherThread)).isEmpty(); }
@Test public void return_empty_user_when_no_realm() { assertThat(underTest.authenticate(new Credentials(LOGIN, PASSWORD), request, BASIC)).isEmpty(); verifyNoMoreInteractions(authenticationEvent); }
@Test public void test_setTimedOut() { underTest.setTimedOut(member); assertThat(underTest.getAnswer(member)).isEmpty(); assertThat(underTest.hasTimedOut(member)).isTrue(); assertThat(underTest.getFailed(member)).isEmpty(); }
@Test public void selectByUuid_returns_row_data_of_specified_uuid() { insertOrganization(ORGANIZATION_DTO_1); assertThat(underTest.selectByUuid(dbSession, "foo uuid")).isEmpty(); }
@Test public void getOptionalById_returns_empty_of_Metric_does_not_exist() { underTest.start(); assertThat(underTest.getOptionalById(SOME_ID)).isEmpty(); }