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

[Serenity - 3.9.8]error: package net.thucydides.core.guice does not exist #3206

Closed
bachhavdipak opened this issue Aug 1, 2023 · 9 comments
Closed

Comments

@bachhavdipak
Copy link
Contributor

Getting below issue with the latest serenity core =3.9.7

error: package net.thucydides.core.guice does not exist
import net.thucydides.core.guice.Injectors;                                                                                 
                                ^                                                                                           
C:\TestAutomation\Properties.java:8: error: cannot find symbol               
    private static final EnvironmentVariables vars = Injectors.getInjector().getProvider(EnvironmentVariables.class).get();
@wakaleo
Copy link
Member

wakaleo commented Aug 1, 2023

We removed guice in 3.9.7. Using internal APIs isn't generally recommended - you can obtain the environment variables simply by including them in your step definition or step library class.

@wakaleo
Copy link
Member

wakaleo commented Aug 1, 2023

The commit logs are fairly well documented. If you would like to help out with the release notes and docs you are more than welcome to help.

@wakaleo
Copy link
Member

wakaleo commented Aug 1, 2023

Alternatively if your company is getting value out of Serenity BDD, you can always opt for a commercial support contract, which can give more options for updates and feature/bug fix requests.

@GauravTyagi007
Copy link

I am also Facing the Same issue but was not able to find any walk around

@wakaleo
Copy link
Member

wakaleo commented Aug 16, 2023

net.thucydides.core.guice.Injectors was an internal Serenity class that is no longer used. See comments above.

@bachhavdipak
Copy link
Contributor Author

@GauravTyagi007 : You can use below code

EnvironmentVariables environmentVariables = SystemEnvironmentVariables.createEnvironmentVariables(); environmentVariables.getProperty("property name")

@GauravTyagi007
Copy link

Its Displaying the error cannot find symbol

@bachhavdipak
Copy link
Contributor Author

@GauravTyagi007 :


import net.thucydides.core.environment.SystemEnvironmentVariables;
import net.thucydides.core.util.EnvironmentVariables;

EnvironmentVariables environmentVariables = SystemEnvironmentVariables.createEnvironmentVariables(); 
environmentVariables.getProperty("property name")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants