@BeforeClass void before() throws Exception { SvnTestHelper.skipTestIfDockerUnavailable(); String gitlabVersion = System.getenv("GITLAB_VERSION"); if (gitlabVersion == null) { if (System.getenv("TRAVIS") != null) throw new SkipException("Only run gitlab tests on Travis when explicitly asked"); gitlabVersion = "latest"; } final int gitlabPort = 80; gitlab = new GenericContainer<>("gitlab/gitlab-ce:" + gitlabVersion) .withEnv("GITLAB_ROOT_PASSWORD", rootPassword) .withExposedPorts(gitlabPort) .waitingFor(Wait.forHttp("/users/sign_in") .withStartupTimeout(Duration.of(10, ChronoUnit.MINUTES))); gitlab.start(); gitlabUrl = "http://" + gitlab.getContainerIpAddress() + ":" + gitlab.getMappedPort(gitlabPort); rootToken = createToken(root, rootPassword, true); final GitlabAPI rootAPI = GitLabContext.connect(gitlabUrl, rootToken); final GitlabUser gitlabUser = rootAPI.createUser(new CreateUserRequest(user, user, "git-as-svn@localhost").setPassword(userPassword)); Assert.assertNotNull(gitlabUser); final GitlabGroup group = rootAPI.createGroup(new CreateGroupRequest("testGroup").setVisibility(GitlabVisibility.PUBLIC), null); Assert.assertNotNull(group); Assert.assertNotNull(rootAPI.addGroupMember(group.getId(), gitlabUser.getId(), GitlabAccessLevel.Developer)); gitlabProject = createGitlabProject(rootAPI, group, "test", GitlabVisibility.INTERNAL, Collections.singleton("git-as-svn")); gitlabPublicProject = createGitlabProject(rootAPI, group, "publik", GitlabVisibility.PUBLIC, Collections.emptySet()); }