Refine search
@Test public void verify_description() { assertThat(underTest.getDescription()).isNotEmpty(); } }
private void verifyCookie(Cookie cookie) { assertThat(cookie.getName()).isEqualTo("OAUTHSTATE"); assertThat(cookie.getValue()).isNotEmpty(); assertThat(cookie.getPath()).isEqualTo("/"); assertThat(cookie.isHttpOnly()).isTrue(); assertThat(cookie.getMaxAge()).isEqualTo(-1); assertThat(cookie.getSecure()).isFalse(); } }
@Test public void name_is_not_empty() { assertThat(underTest.name()).isNotEmpty(); }
@Override public <T extends MigrationStep> MigrationStepRegistry add(long migrationNumber, String description, Class<T> stepClass) { validate(migrationNumber); assertThat(description).isNotEmpty(); assertThat(stepClass).isNotNull(); assertThat(migrationNumbers.add(migrationNumber)).isTrue(); return this; } }
@Test public void getSonarQubeVersion_must_not_return_an_empty_string() { assertThat(SonarQubeVersionHelper.getSonarqubeVersion()).isNotEmpty(); }
private void assertThatProfileIsMarkedAsUpdated(RulesProfileDto dto) { RulesProfileDto reloaded = db.getDbClient().qualityProfileDao().selectBuiltInRuleProfiles(db.getSession()) .stream() .filter(p -> p.getKee().equals(dto.getKee())) .findFirst() .get(); assertThat(reloaded.getRulesUpdatedAt()).isNotEmpty(); }
@Test public void generate_state() { String state = underTest.generateState(request, response, TIMEOUT); assertThat(state).isNotEmpty(); verify(response).addCookie(cookieArgumentCaptor.capture()); verifyCookie(cookieArgumentCaptor.getValue()); }
private void assertThatProfileIsUpdatedByUser(QProfileDto profile) { QProfileDto loaded = db.getDbClient().qualityProfileDao().selectByUuid(db.getSession(), profile.getKee()); assertThat(loaded.getUserUpdatedAt()).isNotNull(); assertThat(loaded.getRulesUpdatedAt()).isNotEmpty(); }
@Test public void init_create_cookie() { when(request.getParameter("return_to")).thenReturn("/settings"); underTest.init(request, response); verify(response).addCookie(cookieArgumentCaptor.capture()); Cookie cookie = cookieArgumentCaptor.getValue(); assertThat(cookie.getName()).isEqualTo(AUTHENTICATION_COOKIE_NAME); assertThat(cookie.getValue()).isNotEmpty(); assertThat(cookie.getPath()).isEqualTo("/"); assertThat(cookie.isHttpOnly()).isTrue(); assertThat(cookie.getMaxAge()).isEqualTo(300); assertThat(cookie.getSecure()).isFalse(); }
@Test public void generate_state() { String state = underTest.generateState(request, response); assertThat(state).isNotEmpty(); verify(response).addCookie(cookieArgumentCaptor.capture()); verifyCookie(cookieArgumentCaptor.getValue()); }
@Test public void create_unique() { Set<String> all = new HashSet<>(); for (int i = 0; i < 50; i++) { String uuid = Uuids.create(); assertThat(uuid).isNotEmpty(); all.add(uuid); } assertThat(all).hasSize(50); }
@Test public void test_metadata() { assertThat(step().toString()).isNotEmpty(); assertThat(step().getDescription()).isNotEmpty(); } }
@Test public void define_index_action() { WebService.Action action = controller.action("index"); assertThat(action).isNotNull(); assertThat(action.responseExampleAsString()).isNotEmpty(); }
@Test public void definition() { assertThat(underTest.path()).isEqualTo("api/project_tags"); assertThat(underTest.since()).isEqualTo("6.4"); assertThat(underTest.description()).isNotEmpty(); }
@Test public void ceworker_created_by_factory_must_contain_uuid() { CeWorker ceWorker = underTest.create(randomOrdinal); assertThat(ceWorker.getUUID()).isNotEmpty(); }
@Test public void toString_does_not_fail_if_empty() { ComponentDto dto = new ComponentDto(); assertThat(dto.toString()).isNotEmpty(); }
@Test public void completeDefaults_set_default_elasticsearch_port_and_bind_address() throws Exception{ Properties p = new Properties(); Props props = new Props(p); ProcessProperties.completeDefaults(props); String address = props.value("sonar.search.host"); assertThat(address).isNotEmpty(); assertThat(InetAddress.getByName(address).isLoopbackAddress()).isTrue(); assertThat(props.valueAsInt("sonar.search.port")).isEqualTo(9001); }
@Test public void test_getDescription() { assertThat(newStep().getDescription()).isNotEmpty(); }
@Test public void define_controller() { assertThat(controller).isNotNull(); assertThat(controller.description()).isNotEmpty(); assertThat(controller.since()).isEqualTo("5.2"); assertThat(controller.actions()).hasSize(2); }
@Test public void binary_file_with_unmappable_character() throws Exception { File woff = new File(this.getClass().getResource("glyphicons-halflings-regular.woff").toURI()); Metadata metadata = new FileMetadata().readMetadata(new FileInputStream(woff), StandardCharsets.UTF_8, woff.getAbsolutePath()); assertThat(metadata.lines()).isEqualTo(135); assertThat(metadata.nonBlankLines()).isEqualTo(133); assertThat(metadata.hash()).isNotEmpty(); assertThat(logTester.logs(LoggerLevel.WARN).get(0)).contains("Invalid character encountered in file"); assertThat(logTester.logs(LoggerLevel.WARN).get(0)).contains( "glyphicons-halflings-regular.woff at line 1 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'."); }