Skip to Content
0
Jan 23, 2020 at 04:03 PM

Error while running web integration tests with ant

105 Views

We have different Integration tests for our web extension (source under <extensionname>/web/src/) under <extensionname>/web/testsrc. Our integration tests work fine with Eclipse (started via Right-Click -> Run As -> JUnit Test), but all integration tests fail if they are started with the allwebtests ant target.

The Test looks like this:

@IntegrationTest
public class SomeControllerIntegrationTest extends ServicelayerBaseTest {

  @Resource
  private SomeController someController;

  @Test
  public void test_getLoginInfo() {
    someController.initCache();
  }
}

The controller looks like this:

@Controller(value = "someController")
@RequestMapping("**/controller/someController")
public class SomeController {
  public void initCache() {
    // some code here
  }
}

The exception:

test SomeControllerIntegrationTest is not properly initialized - missing bean references [someController]

The test extends the ServicelayerBaseTest and is annotated with the Integrationtest Annotation. Why is this not working?

The command used to start the tests: ant allwebtests