Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sudo: required
services:
- docker
jdk:
- oraclejdk8
- openjdk8
install:
- ./mvnw -B -q -Pdocker-gitlab dependency:go-offline verify -DskipTests -Ddocker.skip
script:
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/org/gitlab/api/GitlabAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -2125,13 +2125,9 @@ public List<GitlabCommit> getCommits(GitlabMergeRequest mergeRequest, Pagination
projectId = mergeRequest.getProjectId();
}

Query query = new Query()
.append("ref_name", mergeRequest.getSourceBranch());

query.mergeWith(pagination.asQuery());

String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) +
"/repository" + GitlabCommit.URL + query.toString();
GitlabMergeRequest.URL + "/" + mergeRequest.getIid() +
GitlabCommit.URL + pagination.toString();

GitlabCommit[] commits = retrieve().to(tailUrl, GitlabCommit[].class);
return Arrays.asList(commits);
Expand Down
5 changes: 3 additions & 2 deletions src/test/java/org/gitlab/api/GitlabAPIUT.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.net.NoRouteToHostException;
import java.net.ServerSocket;
import java.net.SocketTimeoutException;

Expand All @@ -23,8 +24,8 @@ public class GitlabAPIUT {
public void unitTest_20180503175711() {
GitlabAPI api = GitlabAPI.connect("http://172.16.0.0:80", "test");
api.setConnectionTimeout(100);
Throwable exception = assertThrows(SocketTimeoutException.class, api::getVersion);
assertThat(exception.getMessage(), is("connect timed out"));
Throwable exception = assertThrows(NoRouteToHostException.class, api::getVersion);
assertThat(exception.getMessage(), is("No route to host"));
}

@Test
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/org/gitlab/api/InstantDeserializerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import java.io.IOException;
import java.time.*;
import java.util.concurrent.TimeUnit;

import static org.junit.jupiter.api.Assertions.*;

Expand All @@ -24,7 +25,7 @@ void deserialize() throws IOException {
assertEquals(Instant.from(
ZonedDateTime.of(
LocalDate.of(2016, 8, 11),
LocalTime.of(11, 28, 34, 85),
LocalTime.of(11, 28, 34, (int) TimeUnit.MILLISECONDS.toNanos(85)),
ZoneOffset.UTC
)
), instant);
Expand Down