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 59b88cf commit aaceb75Copy full SHA for aaceb75
java/src/main/java/io/cucumber/query/Query.java
@@ -247,8 +247,12 @@ public Optional<Location> findLocationOf(Pickle pickle) {
247
public Optional<Pickle> findPickleBy(TestCaseStarted testCaseStarted) {
248
requireNonNull(testCaseStarted);
249
return findTestCaseBy(testCaseStarted)
250
- .map(TestCase::getPickleId)
251
- .map(pickleById::get);
+ .flatMap(this::findPickleBy);
+ }
252
+
253
+ public Optional<Pickle> findPickleBy(TestCase testCase) {
254
+ requireNonNull(testCase);
255
+ return ofNullable(pickleById.get(testCase.getPickleId()));
256
}
257
258
public Optional<Pickle> findPickleBy(TestStepStarted testStepStarted) {
0 commit comments