Update FCommons dependency to 1.2.7

This commit is contained in:
filoghost 2021-04-29 14:38:46 +02:00
parent 92bcda8f2d
commit 03689e208b
3 changed files with 7 additions and 7 deletions

View File

@ -5,7 +5,6 @@
*/
package me.filoghost.holographicdisplays.placeholder.parsing;
import me.filoghost.fcommons.collection.CollectionUtils;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
@ -24,10 +23,6 @@ public class StringWithPlaceholders {
this.string = string;
this.placeholderMatches = findPlaceholders(string);
}
protected List<PlaceholderOccurrence> getPlaceholders() {
return CollectionUtils.transform(placeholderMatches, match -> match.content);
}
public boolean containsPlaceholders() {
return placeholderMatches != null && !placeholderMatches.isEmpty();

View File

@ -10,6 +10,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
@ -47,7 +48,11 @@ class StringWithPlaceholdersTest {
void parsing(String input, String expectedPluginName, String expectedIdentifier, String expectedArgument) {
StringWithPlaceholders s = new StringWithPlaceholders(input);
List<PlaceholderOccurrence> placeholders = s.getPlaceholders();
List<PlaceholderOccurrence> placeholders = new ArrayList<>();
s.replacePlaceholders(occurrence -> {
placeholders.add(occurrence); // Just save occurrences
return null;
});
assertThat(placeholders).hasSize(1);
PlaceholderOccurrence placeholder = placeholders.get(0);

View File

@ -187,7 +187,7 @@
<dependency>
<groupId>me.filoghost.fcommons</groupId>
<artifactId>fcommons</artifactId>
<version>1.2.6-SNAPSHOT</version>
<version>1.2.7</version>
</dependency>
</dependencies>
</dependencyManagement>