-
Notifications
You must be signed in to change notification settings - Fork 332
Expand file tree
/
Copy pathTestIdentifier.java
More file actions
66 lines (54 loc) · 1.59 KB
/
TestIdentifier.java
File metadata and controls
66 lines (54 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package datadog.trace.api.civisibility.config;
import datadog.trace.util.HashingUtils;
import java.util.Objects;
import javax.annotation.Nullable;
/** Uniquely identifies a test case with FQN and parameters. */
public class TestIdentifier {
private final TestFQN fqn;
/**
* Some API endpoints do not return parameters data. If this field is {@code null} then either
* corresponding test case is not parameterized, or this identifier refers to <strong>all</strong>
* parameter variations.
*/
private @Nullable final String parameters;
public TestIdentifier(String suite, String name, @Nullable String parameters) {
this.fqn = new TestFQN(suite, name);
this.parameters = parameters;
}
public TestIdentifier(TestFQN testFQN, @Nullable String parameters) {
this.fqn = testFQN;
this.parameters = parameters;
}
public String getSuite() {
return fqn.getSuite();
}
public String getName() {
return fqn.getName();
}
@Nullable
public String getParameters() {
return parameters;
}
public TestFQN toFQN() {
return fqn;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TestIdentifier that = (TestIdentifier) o;
return Objects.equals(fqn, that.fqn) && Objects.equals(parameters, that.parameters);
}
@Override
public int hashCode() {
return HashingUtils.hash(fqn, parameters);
}
@Override
public String toString() {
return "TestIdentifier{" + "fqn=" + fqn + ", parameters='" + parameters + '\'' + '}';
}
}