Skip to content

Commit

Permalink
fix: corrected UnsatisfiableDependencyException with disposables depe…
Browse files Browse the repository at this point in the history
…ndencies for #2762
  • Loading branch information
Julien Kronegg committed May 26, 2023
1 parent 383ab6d commit 9dd73c0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [Core] Fixed `cucumber.publish.enabled=false` ([#2747](https://github.com/cucumber/cucumber-jvm/pull/2747) M.P. Korstanje)
- [JUnit Platform Engine] Fixed `cucumber.publish.enabled=false` ([#2747](https://github.com/cucumber/cucumber-jvm/pull/2747) M.P. Korstanje)
- [Java] Fixed duplicate step definition for classes with interfaces ([#2757](https://github.com/cucumber/cucumber-jvm/issues/2757) Julien Kronegg)
- [Pico] Fixed unsatisfiable dependency with disposables ([#2762](https://github.com/cucumber/cucumber-jvm/issues/2762) Julien Kronegg)

## [7.12.0] - 2023-04-29
### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public void stop() {
@Override
public boolean addClass(Class<?> clazz) {
if (isInstantiable(clazz) && classes.add(clazz)) {
pico.addComponent(clazz);
addConstructorDependencies(clazz);
pico.addComponent(clazz);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.cucumber.picocontainer;

import org.picocontainer.Disposable;

public class StepDefinitionsWithTransitiveDependencies {

final FirstDependency firstDependency;
Expand All @@ -8,12 +10,16 @@ public StepDefinitionsWithTransitiveDependencies(FirstDependency firstDependency
this.firstDependency = firstDependency;
}

public static class FirstDependency {
public static class FirstDependency implements Disposable {
final SecondDependency secondDependency;

public FirstDependency(SecondDependency secondDependency) {
this.secondDependency = secondDependency;
}

@Override
public void dispose() {
}
}

public static class SecondDependency {
Expand Down

0 comments on commit 9dd73c0

Please sign in to comment.