We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0ad9b4 commit cbbca06Copy full SHA for cbbca06
java/src/main/java/io/cucumber/query/Query.java
@@ -264,8 +264,12 @@ public Optional<Location> findLocationOf(Pickle pickle) {
264
public Optional<Pickle> findPickleBy(TestCaseStarted testCaseStarted) {
265
requireNonNull(testCaseStarted);
266
return findTestCaseBy(testCaseStarted)
267
- .map(TestCase::getPickleId)
268
- .map(pickleById::get);
+ .flatMap(this::findPickleBy);
+ }
269
+
270
+ public Optional<Pickle> findPickleBy(TestCase testCase) {
271
+ requireNonNull(testCase);
272
+ return ofNullable(pickleById.get(testCase.getPickleId()));
273
}
274
275
public Optional<Pickle> findPickleBy(TestStepStarted testStepStarted) {
0 commit comments