-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
plugin/src/test/java/io/jenkins/plugins/analysis/core/steps/AnalysisStepDescriptorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.jenkins.plugins.analysis.core.steps; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import io.jenkins.plugins.analysis.core.steps.ScanForIssuesStep.Descriptor; | ||
|
||
import static org.assertj.core.api.Assertions.*; | ||
|
||
/** | ||
* Tests the class {@link AnalysisStepDescriptor}. | ||
* | ||
* @author Ullrich Hafner | ||
*/ | ||
class AnalysisStepDescriptorTest { | ||
@Test | ||
void shouldPrintArgumentsToString() { | ||
Descriptor descriptor = new Descriptor(); | ||
|
||
assertThat(descriptor.argumentsToString(new HashMap<>())).isEqualTo("{}"); | ||
|
||
Map<String, Object> singleton = new HashMap<>(); | ||
singleton.put("key", "value"); | ||
assertThat(descriptor.argumentsToString(singleton)).isEqualTo("value"); | ||
|
||
Map<String, Object> multiple = new HashMap<>(); | ||
multiple.put("key-1", "value-1"); | ||
multiple.put("key-2", "value-2"); | ||
assertThat(descriptor.argumentsToString(multiple)).isEqualTo("{key-1=value-1, key-2=value-2}"); | ||
} | ||
} |