0

I have an API written in Dagger with maven and it already has some Functional tests. When I run

mvn clean verify

The tests work correctly. However when I try to run them from the IDE, or debug them, the Dagger auto generated code inside the generated-tests-sources folder complains about a class that cannot be found.

Basically there's a Dagger config class like this:

public interface TestConfigComponent {
    ...
    void inject(BaseFT basefT);
}

And in BaseFT we have something like this:

  @Before
  public void beforeTest() throws Exception {
 
    DaggerTestConfigComponent.create().inject(this);

  }

Now to be honest I truly don't understand the difference between executing the tests via mvn verify and doing it by pushing the "play" button on intellij, but it's clear that something's missing in my intellij configuration to be able to debug these tests, what do I have to do to accomplish this goal?

And the FT all inherit from the BaseFT class:

public class MyBeautifulFT extends BaseFT{

}

And the error message is the following:

java: cannot find symbol
  symbol:   class BaseFT
  location: package com.package.name
carlos palma
  • 722
  • 3
  • 12
  • 29
  • Are you using the "Run tests" button as in [the basic documentation here](https://www.jetbrains.com/help/idea/performing-tests.html#run-tests), or the [Maven delegate documentation here](https://www.jetbrains.com/help/idea/delegate-build-and-run-actions-to-maven.html#run_debug_with_maven), or the [Maven testing page here](https://www.jetbrains.com/help/idea/work-with-tests-in-maven.html)? – Jeff Bowman May 30 '23 at 21:40
  • Hello @Jeff Bowman, thank you for your interest in my question. I tried the basic documentation first with the error result shown in the question, then I switched to the maven delegate. After switching the debug option is grey and I cannot click it. – carlos palma May 31 '23 at 22:10

0 Answers0