Search in sources :

Example 1 with IdentityWriter

use of com.b2international.snowowl.core.identity.IdentityWriter in project snow-owl by b2ihealthcare.

the class SnowOwlAppRule method before.

@Override
protected void before() throws Throwable {
    super.before();
    snowowl = SnowOwl.create(this.plugins);
    if (clearResources) {
        final File resourceDirectory = snowowl.getEnviroment().getDataPath().toFile();
        FileUtils.cleanDirectory(resourceDirectory);
    }
    snowowl.bootstrap();
    snowowl.run();
    // inject the test user to the current identity provider
    try {
        ((IdentityWriter) ApplicationContext.getInstance().getServiceChecked(IdentityProvider.class)).addUser(RestExtensions.USER, RestExtensions.PASS);
    } catch (AlreadyExistsException e) {
    // ignore existing user
    }
}
Also used : AlreadyExistsException(com.b2international.commons.exceptions.AlreadyExistsException) IdentityWriter(com.b2international.snowowl.core.identity.IdentityWriter) IdentityProvider(com.b2international.snowowl.core.identity.IdentityProvider) File(java.io.File)

Aggregations

AlreadyExistsException (com.b2international.commons.exceptions.AlreadyExistsException)1 IdentityProvider (com.b2international.snowowl.core.identity.IdentityProvider)1 IdentityWriter (com.b2international.snowowl.core.identity.IdentityWriter)1 File (java.io.File)1