Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pico] Fixed UnsatisfiableDependencyException with Component dependencies #2764

Merged
merged 3 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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