Publisher artifactArchiver = new ArtifactArchiver("f", "", true);
project.getPublishersList().replaceBy(Collections.singleton(artifactArchiver));
project.getBuildersList().replaceBy(Collections.singleton(new CreateArtifact()));
assertEquals(Result.SUCCESS, build(project)); // #1
assertTrue(project.getBuildByNumber(1).getHasArtifacts());
project.getPublishersList().replaceBy(Arrays.asList(artifactArchiver, new TestsFail()));
assertEquals(Result.UNSTABLE, build(project)); // #2
assertTrue(project.getBuildByNumber(1).getHasArtifacts());
assertTrue(project.getBuildByNumber(2).getHasArtifacts());
assertEquals(Result.UNSTABLE, build(project)); // #3
assertTrue(project.getBuildByNumber(1).getHasArtifacts());