Skip to content

Commit

Permalink
Replace empty property with "-".
Browse files Browse the repository at this point in the history
Otherwise the hyperlink is not clickable.
  • Loading branch information
uhafner committed Mar 6, 2024
1 parent 63180f5 commit 9e6bb4a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public String getProperty() {
* @return the display name
*/
public String getDisplayName(final String key) {
return propertyFormatter.apply(key);
return StringUtils.defaultIfBlank(propertyFormatter.apply(key), "-");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class PropertyStatisticsTest {
private static final String KEY = "key";

/**
* Verifies that getTotal() returns the total number of issues if there is one issues.
* Verifies that getTotal() returns the total number of issues if there is one issue.
*/
@Test
void shouldReturnTotalNumber() {
Expand All @@ -37,7 +37,7 @@ void shouldReturnTotalNumber() {
}

/**
* Verifies that getTotal() returns the total number of issues if there is one issues.
* Verifies that getTotal() returns the total number of issues if there is one issue.
*/
@Test
void shouldReturnTotalNumberMoreIssues() {
Expand Down Expand Up @@ -136,7 +136,7 @@ void shouldReturnAllKeys() {
}

/**
* Verifies that getKeys() returns empty string if the instances for this property is empty.
* Verifies that getKeys() returns "-" string if the instances for this property are empty.
*/
@Test
void shouldReturnEmptyStringKeys() {
Expand All @@ -147,7 +147,7 @@ void shouldReturnEmptyStringKeys() {
PropertyStatistics statistics = new PropertyStatistics(issues, new Report(), "category",
Function.identity());

assertThat(statistics).hasOnlyKeys("");
assertThat(statistics).hasOnlyKeys("-");
}
}

Expand Down Expand Up @@ -178,7 +178,7 @@ void shouldReturnMaxValueZero() {
}

/**
* Verifies that getMax() returns one if there is one issues.
* Verifies that getMax() returns one if there is one issue.
*/
@Test
void shouldReturnMaxValue() {
Expand Down Expand Up @@ -245,7 +245,7 @@ void shouldReturnCountEmpty() {
}

/**
* Verifies that getCount() returns one if there is one issues for the specified property instance.
* Verifies that getCount() returns one if there is one issue for the specified property instance.
*/
@Test
void shouldReturnCountOne() {
Expand Down Expand Up @@ -546,7 +546,7 @@ void shouldReturnNewCountOne() {
}

/**
* Verifies that getNewCount() returns zero if there is one issues for the specified property instance, but it isn't new.
* Verifies that getNewCount() returns zero if there is one issue for the specified property instance, but it isn't new.
*/
@Test
void shouldReturnNewCountZero() {
Expand Down

0 comments on commit 9e6bb4a

Please sign in to comment.