Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump org.jvnet.hudson.plugins:analysis-pom from 6.17.0 to 7.0.0 #242

Merged
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>6.17.0</version>
<version>7.0.0</version>
<relativePath />
</parent>

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

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 java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
Expand All @@ -17,15 +10,23 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static org.assertj.core.api.Assertions.assertThat;
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.*;

/**
* Test Class for {@link FontAwesomeIcons}.
*
* @author strangelookingnerd
*/
class FontAwesomeIconsTest {

@BeforeAll
static void init() {
assertThat(
Expand All @@ -42,14 +43,13 @@ void testGetIconClassName() {
@ParameterizedTest
@NullSource
@EnumSource(SvgTag.FontAwesomeStyle.class)
void testGetAvailableIconsFiltered(final SvgTag.FontAwesomeStyle style) throws Exception {
void testGetAvailableIconsFiltered(@CheckForNull final SvgTag.FontAwesomeStyle style) throws Exception {
Map<String, String> availableIcons = style == null ? FontAwesomeIcons.getAvailableIcons() : FontAwesomeIcons.getAvailableIcons(style);

assertThat(availableIcons).isNotNull().isNotEmpty();

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"))
Expand All @@ -62,5 +62,4 @@ void testGetAvailableIconsFiltered(final SvgTag.FontAwesomeStyle style) throws E
}
}
}

}
Loading