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

False @ClassRule Warning #215

Closed
garyluu opened this issue Jul 4, 2019 · 2 comments
Closed

False @ClassRule Warning #215

garyluu opened this issue Jul 4, 2019 · 2 comments
Labels

Comments

@garyluu
Copy link

garyluu commented Jul 4, 2019

Description of the bug

Even when used with @ClassRule the It is recommended to use HoverflyRule with @ClassRule warning still appears

Steps to reproduce the issue

public class IT {
    @ClassRule
    public static HoverflyRule hoverflyRule = HoverflyRule.inSimulationMode(SIMULATION_SOURCE);

    @Rule
    public TestRule watcher = new TestWatcher() {
        protected void starting(Description description) {
            System.out.println("Starting test: " + description.getMethodName());
        }
    };

    @Test
    public void test() {
    }
}

Observed result

Hoverfly Java and Hoverfly error messages seen (If none, say none)

16:17:20.400 [main] WARN  i.s.hoverfly.junit.rule.HoverflyRule - It is recommended to use HoverflyRule with @ClassRule to get better performance in your tests, and prevent known issue with Apache HttpClient. For more information, please see http://hoverfly-java.readthedocs.io/en/latest/pages/misc/misc.html#apache-httpclient.

If possible, add screenshots to help explain your problem

Expected result

There should be no warning

Additional relevant information

If not indicated above:

  1. Hoverfly Java version: 0.12.0
  2. Anything that might help us to diagnose the problem
    Removing the watcher seems to also remove the warning
@tommysitu tommysitu added the bug label Jul 7, 2019
@tommysitu
Copy link
Member

I can reproduce the issue, this method could be buggy: https://github.com/SpectoLabs/hoverfly-java/blob/master/src/main/java/io/specto/hoverfly/junit/rule/HoverflyRule.java#L285

You're welcome to send a PR if you have a solution. Thanks!

tommysitu added a commit that referenced this issue Jul 19, 2019
@tommysitu
Copy link
Member

Fixed in 0.12.1

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

No branches or pull requests

2 participants