tree: aff04a748704b683fed71a845cf23fa593595f2b [path history] [tgz]
  1. src/
  2. pom.xml

Apache Unomi Integration tests


You will likely run into situation where you need to wait for the execution of your test.
To do so please avoid long Thread.sleep(10000) it tend to make the test unstable, prefer a shorter sleep that you will repeat.

boolean isDone = false;
while (!isDone) {
    importConfiguration = importConfigurationService.load(itemId);
    if (importConfiguration != null && importConfiguration.getStatus() != null) {
        isDone = importConfiguration.getStatus().equals(RouterConstants.CONFIG_STATUS_COMPLETE_SUCCESS);

NEVER create dependencies between your test, even in the same class, the execution order is not guaranteed therefore you may not have what you expect and it could work fine on your machine but not on others.

If possible clean what your test created at the end of its execution or at the very least make sure to use unique IDs

When you need a service from Unomi to execute your test inject it with a filer:

@Inject @Filter(timeout = 60000)
protected ProfileService profileService;

This will ensure the service is available before starting the test and if you need a resource like an URL you can do something like this:

@Inject @Filter(value="(configDiscriminator=IMPORT)", timeout = 60000)
protected ImportExportConfigurationService<ImportConfiguration> importConfigurationService;