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 a5b89f4 commit a3aaa98Copy full SHA for a3aaa98
java/src/main/java/io/cucumber/query/Query.java
@@ -253,8 +253,12 @@ public Optional<Location> findLocationOf(Pickle pickle) {
253
public Optional<Pickle> findPickleBy(TestCaseStarted testCaseStarted) {
254
requireNonNull(testCaseStarted);
255
return findTestCaseBy(testCaseStarted)
256
- .map(TestCase::getPickleId)
257
- .map(pickleById::get);
+ .flatMap(this::findPickleBy);
+ }
258
+
259
+ public Optional<Pickle> findPickleBy(TestCase testCase) {
260
+ requireNonNull(testCase);
261
+ return ofNullable(pickleById.get(testCase.getPickleId()));
262
}
263
264
public Optional<Pickle> findPickleBy(TestStepStarted testStepStarted) {
0 commit comments