Skip to content

Commit 825db3c

Browse files
author
Oleg.Maiboroda
committed
Add UTs
1 parent 33457ae commit 825db3c

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/test/java/hudson/plugins/robot/tokens/RobotReportLinkTokenMacroTest.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,31 @@ void testAcceptsName() {
4141
}
4242

4343
@Test
44-
void testTokenConversionWithoutLogLink() throws Exception {
44+
void testLocalTokenConversionWithoutLogLink() throws Exception {
4545
action = new RobotBuildAction(build, result, "", listener, null, null, false, "", false, false);
4646
when(build.getAction(RobotBuildAction.class)).thenReturn(action);
4747
assertEquals("job/robotjob/1/robot/report/", token.evaluate(build, listener, macroName));
4848
}
4949

5050
@Test
51-
void testTokenConversionWithLogLink() throws Exception {
51+
void testLocalTokenConversionWithLogLink() throws Exception {
5252
action = new RobotBuildAction(build, result, "", listener, "log.html", null, false, "", false, false);
5353
when(build.getAction(RobotBuildAction.class)).thenReturn(action);
5454
assertEquals("job/robotjob/1/robot/report/log.html", token.evaluate(build, listener, macroName));
5555
}
56+
57+
@Test
58+
void testArtifactTokenConversionWithoutLogLink() throws Exception {
59+
action = new RobotBuildAction(build, result, "", listener, null, null, false, "", false, true);
60+
when(build.getAction(RobotBuildAction.class)).thenReturn(action);
61+
assertEquals("job/robotjob/1/artifact/", token.evaluate(build, listener, macroName));
62+
}
63+
64+
@Test
65+
void testArtifactTokenConversionWithLogLink() throws Exception {
66+
action = new RobotBuildAction(build, result, "", listener, "log.html", null, false, "", false, true);
67+
when(build.getAction(RobotBuildAction.class)).thenReturn(action);
68+
assertEquals("job/robotjob/1/artifact/log.html", token.evaluate(build, listener, macroName));
69+
}
5670
}
5771

0 commit comments

Comments
 (0)