Skip to content

Commit

Permalink
Make SvgTagTest an integration test.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Jul 14, 2023
1 parent 4681211 commit 673e07f
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
38 changes: 38 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<changelist>-SNAPSHOT</changelist>

<module.name>${project.groupId}.font-awesome-api</module.name>
<testcontainers.version>1.18.3</testcontainers.version>

</properties>

Expand Down Expand Up @@ -51,6 +52,43 @@
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>ssh-credentials</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>ssh-slaves</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-job</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@

import org.junit.jupiter.api.Test;

import io.jenkins.plugins.util.IntegrationTestWithJenkinsPerSuite;

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

class SvgTagTest {
class SvgTagITest extends IntegrationTestWithJenkinsPerSuite {
@Test
void shouldCreateTag() {
var tag = new SvgTag("left");
var tag = new SvgTag("tag");

assertThat(tag.toString()).contains("classes=icon-md", "name=solid/left", "pluginName=font-awesome-api");
assertThat(tag.toString()).contains("classes=icon-md", "name=solid/tag", "pluginName=font-awesome-api");

tag.withClasses("additional");
assertThat(tag.toString()).contains("classes=additional icon-md");

tag.withClasses("one two");
assertThat(tag.toString()).contains("classes=one two icon-md");

tag.withClasses("one two");
assertThat(tag.render()).contains("class=\"one two icon-md\"", "xmlns=\"http://www.w3.org/2000/svg\"",
"https://fontawesome.com ", "<svg ", "</svg>");
}
}

0 comments on commit 673e07f

Please sign in to comment.