@@ -0,0 +1,2833 @@
+/**%0A * Licensed to the Austrian Association for Software Tool Integration (AASTI)%0A * under one or more contributor license agreements. See the NOTICE file%0A * distributed with this work for additional information regarding copyright%0A * ownership. The AASTI licenses this file to you under the Apache License,%0A * Version 2.0 (the %22License%22); you may not use this file except in compliance%0A * with the License. You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.openengsb.itests.exam;%0A%0Aimport static org.hamcrest.CoreMatchers.not;%0Aimport static org.hamcrest.CoreMatchers.nullValue;%0Aimport static org.junit.Assert.assertThat;%0A%0Aimport java.util.concurrent.Callable;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.openengsb.connector.usernamepassword.Password;%0Aimport org.openengsb.core.api.security.model.Authentication;%0Aimport org.openengsb.core.api.security.service.UserDataManager;%0Aimport org.openengsb.core.common.util.SecurityUtils;%0Aimport org.openengsb.domain.authentication.AuthenticationDomain;%0Aimport org.openengsb.itests.util.AbstractPreConfiguredExamTestHelper;%0Aimport org.ops4j.pax.exam.junit.JUnit4TestRunner;%0A%0A@RunWith(JUnit4TestRunner.class)%0A// This one will run each test in it's own container (slower speed)%0A// @ExamReactorStrategy(AllConfinedStagedReactorFactory.class)%0Apublic class UserManagementIT extends AbstractPreConfiguredExamTestHelper %7B%0A%0A    private UserDataManager userManager;%0A    private AuthenticationDomain authenticator;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        userManager = getOsgiService(UserDataManager.class);%0A        authenticator = getOsgiService(AuthenticationDomain.class, %22(location.root=authentication-root)%22, 20000);%0A    %7D%0A%0A    @After%0A    public void tearDown() throws Exception %7B%0A        userManager.deleteUser(%22test%22);%0A    %7D%0A%0A    @Test%0A    public void createUserAndLogin_shouldAuthenticateSuccessful() throws Exception %7B%0A        SecurityUtils.executeWithSystemPermissions(new Callable%3CObject%3E() %7B%0A            @Override%0A            public Object call() throws Exception %7B%0A                userManager.createUser(%22test%22);%0A                userManager.setUserCredentials(%22test%22, %22password%22, %22password%22);%0A                return null;%0A            %7D%0A        %7D);%0A        Authentication authenticate = authenticator.authenticate(%22test%22, new Password(%22password%22));%0A        assertThat(authenticate, not(nullValue()));%0A    %7D%0A%0A%7D%0A

add user-management-itest