Fix TruthAssertExpected error flagged by error prone
Running recent error prone version complaining on that code:
GetRemoteIT.java:95: error: [TruthAssertExpected] The actual and \
expected values appear to be swapped, which results in poor \
assertion failure messages. The actual value should come first.
assertThat(expected).isEqualTo(asRemoteInfo(res.getEntityContent()));
^
(see https://errorprone.info/bugpattern/TruthAssertExpected)
Bug: Issue 12677
Change-Id: If8c16b123cf3696ec7eadee2f40a40310f7a8e79
diff --git a/src/test/java/com/googlesource/gerrit/plugins/webhooks/rest/GetRemoteIT.java b/src/test/java/com/googlesource/gerrit/plugins/webhooks/rest/GetRemoteIT.java
index 585fda6..0521a73 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/webhooks/rest/GetRemoteIT.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/webhooks/rest/GetRemoteIT.java
@@ -92,7 +92,7 @@
push(webhooksConfig);
RestResponse res = adminRestSession.get(endpoint);
assertThat(res.getStatusCode()).isEqualTo(200);
- assertThat(expected).isEqualTo(asRemoteInfo(res.getEntityContent()));
+ assertThat(asRemoteInfo(res.getEntityContent())).isEqualTo(expected);
}
@Test
@@ -128,7 +128,7 @@
push(webhooksConfig);
RestResponse res = adminRestSession.get(endpoint);
assertThat(res.getStatusCode()).isEqualTo(SC_OK);
- assertThat(expected).isEqualTo(asMap(res.getEntityContent()));
+ assertThat(asMap(res.getEntityContent())).isEqualTo(expected);
}
private void push(String content) throws Exception {