PushOneCommit: Add assertions against null ref update result
Change-Id: I541f4cf59d374a8114e4c127b478b2fea5cbe30b
This commit is contained in:
parent
f113d8aa95
commit
202f8f3c5d
@ -416,6 +416,7 @@ public class PushOneCommit {
|
||||
|
||||
public void assertErrorStatus() {
|
||||
RemoteRefUpdate refUpdate = result.getRemoteUpdate(ref);
|
||||
assertThat(refUpdate).isNotNull();
|
||||
assertThat(refUpdate.getStatus())
|
||||
.named(message(refUpdate))
|
||||
.isEqualTo(Status.REJECTED_OTHER_REASON);
|
||||
@ -423,17 +424,20 @@ public class PushOneCommit {
|
||||
|
||||
private void assertStatus(Status expectedStatus, String expectedMessage) {
|
||||
RemoteRefUpdate refUpdate = result.getRemoteUpdate(ref);
|
||||
assertThat(refUpdate).isNotNull();
|
||||
assertThat(refUpdate.getStatus()).named(message(refUpdate)).isEqualTo(expectedStatus);
|
||||
assertThat(refUpdate.getMessage()).isEqualTo(expectedMessage);
|
||||
}
|
||||
|
||||
public void assertMessage(String expectedMessage) {
|
||||
RemoteRefUpdate refUpdate = result.getRemoteUpdate(ref);
|
||||
assertThat(refUpdate).isNotNull();
|
||||
assertThat(message(refUpdate).toLowerCase()).contains(expectedMessage.toLowerCase());
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
RemoteRefUpdate refUpdate = result.getRemoteUpdate(ref);
|
||||
assertThat(refUpdate).isNotNull();
|
||||
return message(refUpdate);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user