CustomPicoFactory Not getting picked after upgrading to io.cucumber versions 4.7.2
See original GitHub issueTried above mentioned solution. Cucumber runner is not picking CustomPicoFactory I am not using DynamicBrowserManager at this moment because I am writing BDD for REST API’s
public class CustomPicoFactory implements ObjectFactory {
private PicoFactory delegate = new PicoFactory();
public CustomPicoFactory() {
addClass(SomeImplementation.class)
}
@Override
public void start() {
delegate.start();
}
@Override
public void stop() {
delegate.stop();
}
@Override
public boolean addClass(Class<?> aClass) {
return delegate.addClass(aClass);
}
@Override
public <T> T getInstance(Class<T> aClass) {
return delegate.getInstance(aClass);
}
}
Even added entry of CustomPicoFactory to cucumber.properties No error while running feature files Logs
INFO: Loading ObjectFactory via service loader: io.cucumber.picocontainer.PicoFactory
Cucumber Version = 4.7.2
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Cucumber V4 [io.cucumber] is not identifying @Given/When ...
I have resolved the issue and sharing correct set of dependency. Please add JUnit/TestNG based on your framework requirement.
Read more >Using Dependency Injectors to Simplify Your Code in Cucumber
At their core, Dependency Injectors (DIs) are about being able to extend an object's behavior at runtime by injecting business logic.
Read more >Upgrading - Cucumber Documentation
We try to add new features to Cucumber periodically. This means you may want to upgrade to a newer version to take advantage...
Read more >Getting started with Cucumber in Java — A 10 minute tutorial
Create a Maven project · Click the menu option File > New > Project · In the New project dialog box, select Maven...
Read more >Deprecated List (Cucumber-JVM: Core 4.7.2 API) - javadoc.io
as of version 4.0.0; use EventListener and Plugin instead. ... in favor of StepDefinedEvent , as Lambda Step Definitions are not reported through...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FQN = Full Quallified Name
Given your packages is com.example and your custom Objectfactory has CustomPicoFactory as classname then the fqn is com.example.CustomPicoFactory
The shown service-descriptor is for the default picofactory. You need your own
io.cucumber.core.backend.ObjectFactory
in your jar.After upgrading pico-container version 5.0.0-RC1 from 1.2.5 i have started getting error message and desperately looking for help as our current production code is failing due to this migration.
Any help asap would be appreciated.
Maven pom.xml change
Upgraded from this info.cukes cucumber-picocontainer 1.2.5
To this io.cucumber cucumber-picocontainer 5.0.0-RC1 test
I am creating an instance of page class during runtime using these 4 list of classes
Basepage.java
public class BasePage {
}
BaseSteps.java
import io.cucumber.java8.En; import org.picocontainer.annotations.Inject;
public class BaseSteps implements En {
}
PageContainer.java
public class PageContainer {
}
PicoDependencyInjector.java
import io.cucumber.core.backend.ObjectFactory; import io.cucumber.picocontainer.PicoFactory;
public class PicoDependencyInjector implements ObjectFactory {
}
cucumber.properties
io.cucumber.core.backend.ObjectFactory = com.footlocker.core.PicoDependencyInjector
Error i am getting is
org.picocontainer.injectors.AbstractInjector$UnsatisfiableDependenciesException: com.footlocker.steps.RegisterMultiUserSteps has unsatisfied dependency for fields [com.footlocker.core.PageContainer.pageContainer] from org.picocontainer.DefaultPicoContainer@661972b0:5<|