use of org.gitlab4j.api.GitLabApi in project nivio by dedica-team.
the class GitLabConfigTest method getGitLabAPI.
@Test
void getGitLabAPI() {
GitLabProperties gitLabProperties = new GitLabProperties("", "token-string-here123", "abracadabra", "123456789");
GitLabConfig gitLabConfig = new GitLabConfig(gitLabProperties);
GitLabApi gitLabApi = gitLabConfig.getGitLabAPI();
assertNotNull(gitLabApi);
assertFalse(gitLabApi == null);
assertTrue(gitLabProperties.getHostUrl().isEmpty());
}
use of org.gitlab4j.api.GitLabApi in project nivio by dedica-team.
the class GitLabConfigTest method testGetGitLabAPI.
@Test
void testGetGitLabAPI() {
GitLabProperties gitLabProperties = new GitLabProperties("http://gitlab.example.com", "token-string-here123", "abracadabra", "123456789");
GitLabConfig gitLabConfig = new GitLabConfig(gitLabProperties);
String hostUrl = gitLabProperties.getHostUrl();
Optional<String> personalAccessToken = Optional.ofNullable(gitLabProperties.getPersonalAccessToken());
Optional<String> username = Optional.ofNullable(gitLabProperties.getUsername());
Optional<String> password = Optional.ofNullable(gitLabProperties.getPassword());
GitLabApi gitLabApi = gitLabConfig.getGitLabAPI(hostUrl, personalAccessToken, username, password);
assertNotNull(gitLabApi);
assertFalse(gitLabApi == null);
assertThat(hostUrl.isEmpty());
assertThat(personalAccessToken.isPresent());
assertThat(username.isPresent());
assertThat(password.isPresent());
}
Aggregations