Skip to content

Commit c65852a

Browse files
committed
Fix factoring of getArtifactPath()
1 parent 1f630b6 commit c65852a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/main/java/com/nordstrom/automation/junit/ArtifactCollector.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ public Optional<Path> captureArtifact(Throwable reason) {
125125
*/
126126
private Path getCollectionPath() {
127127
Path collectionPath = PathUtils.ReportsDirectory.getPathForObject(getInstance());
128-
return collectionPath.resolve(getArtifactPath(getInstance()));
128+
Path artifactPath = provider.getArtifactPath(getInstance());
129+
if (artifactPath == null) {
130+
artifactPath = getArtifactPath(getInstance());
131+
}
132+
return collectionPath.resolve(artifactPath);
129133
}
130134

131135
/**
@@ -136,12 +140,8 @@ private Path getCollectionPath() {
136140
* @param instance JUnit test class instance
137141
* @return artifact storage path
138142
*/
139-
private Path getArtifactPath(Object instance) {
140-
Path artifactPath = provider.getArtifactPath(instance);
141-
if (artifactPath == null) {
142-
artifactPath = PathUtils.ReportsDirectory.getPathForObject(instance);
143-
}
144-
return artifactPath;
143+
public static Path getArtifactPath(Object instance) {
144+
return PathUtils.ReportsDirectory.getPathForObject(instance);
145145
}
146146

147147
/**

0 commit comments

Comments
 (0)