@Rule public JenkinsRule r = new JenkinsRule();
@Test public void artifactArchiver() throws Exception {
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p");
p.setDefinition(new CpsFlowDefinition("node {sh 'touch x.txt'; step([$class: 'ArtifactArchiver', artifacts: 'x.txt', fingerprint: true])}"));
WorkflowRun b = r.assertBuildStatusSuccess(p.scheduleBuild2(0));
List<WorkflowRun.Artifact> artifacts = b.getArtifacts();
assertEquals(1, artifacts.size());
assertEquals("x.txt", artifacts.get(0).relativePath);
Fingerprinter.FingerprintAction fa = b.getAction(Fingerprinter.FingerprintAction.class);
assertNotNull(fa);