Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>analysis-pom</artifactId>
<version>11.2846.v4a_6b_a_1222295</version>
<version>11.2852.v88a_36fe3230d</version>
<relativePath />
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package io.jenkins.plugins.fontawesome;

import org.apache.commons.lang3.Strings;

import edu.umd.cs.findbugs.annotations.CheckForNull;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
Expand All @@ -17,10 +21,6 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.apache.commons.lang3.StringUtils;

import edu.umd.cs.findbugs.annotations.CheckForNull;

import io.jenkins.plugins.fontawesome.SvgTag.FontAwesomeStyle;

/**
Expand Down Expand Up @@ -75,10 +75,10 @@
while (urls.hasMoreElements()) {
URL url = urls.nextElement();

if (StringUtils.contains(url.toExternalForm(), FONT_AWESOME_API_PLUGIN)) {
if (Strings.CS.contains(url.toExternalForm(), FONT_AWESOME_API_PLUGIN)) {

Check warning on line 78 in src/main/java/io/jenkins/plugins/fontawesome/FontAwesomeIcons.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 78 is only partially covered, one branch is missing
URI uri = url.toURI();

if (StringUtils.equals(uri.getScheme(), "jar")) {
if (Strings.CS.contains(uri.getScheme(), "jar")) {

Check warning on line 81 in src/main/java/io/jenkins/plugins/fontawesome/FontAwesomeIcons.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 81 is only partially covered, one branch is missing
try (FileSystem fileSystem = FileSystems.newFileSystem(uri, Collections.emptyMap())) {
return filterIcons(fileSystem.getPath(IMAGES_SYMBOLS_PATH), filter);
}
Expand Down Expand Up @@ -114,11 +114,11 @@

private static String createFileName(final Path icon) {
return icon.getParent().getFileName() + "/"
+ StringUtils.removeEnd(icon.getFileName().toString(), SVG_FILE_ENDING);
+ Strings.CS.removeEnd(icon.getFileName().toString(), SVG_FILE_ENDING);
}

private static boolean isSvgImage(final Path path) {
return StringUtils.endsWith(path.getFileName().toString(), SVG_FILE_ENDING);
return Strings.CS.endsWith(path.getFileName().toString(), SVG_FILE_ENDING);
}

private FontAwesomeIcons() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
package io.jenkins.plugins.fontawesome;

import org.apache.commons.lang3.Strings;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
import org.junit.jupiter.params.provider.NullSource;

import edu.umd.cs.findbugs.annotations.CheckForNull;

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
Expand All @@ -10,15 +19,6 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.apache.commons.lang3.StringUtils;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
import org.junit.jupiter.params.provider.NullSource;

import edu.umd.cs.findbugs.annotations.CheckForNull;

import static org.assertj.core.api.Assertions.*;

/**
Expand Down Expand Up @@ -51,8 +51,8 @@ void testGetAvailableIconsFiltered(@CheckForNull final SvgTag.FontAwesomeStyle s
try (Stream<Path> stream = Files
.walk(Paths.get("./target/classes/images/symbols/" + (style == null ? "" : style.name().toLowerCase(Locale.ENGLISH))), 2)) {
Set<String> iconNames = stream
.filter(path -> StringUtils.endsWith(path.getFileName().toString(), ".svg"))
.map(path -> path.getParent().getFileName().toString() + "/" + StringUtils.removeEnd(path.getFileName().toString(), ".svg"))
.filter(path -> Strings.CS.endsWith(path.getFileName().toString(), ".svg"))
.map(path -> path.getParent().getFileName().toString() + "/" + Strings.CS.removeEnd(path.getFileName().toString(), ".svg"))
.collect(Collectors.toSet());

assertThat(availableIcons.keySet()).isEqualTo(iconNames);
Expand Down
Loading