Skip to content

Commit

Permalink
chore: use assertEquals to improve test error message (#1470)
Browse files Browse the repository at this point in the history
* chore: use assertEquals to improve test error message

* chore: lint

---------

Co-authored-by: Min Zhu <zhumin@google.com>
Co-authored-by: Lawrence Qiu <lawrenceqiu@google.com>
  • Loading branch information
3 people authored Aug 29, 2024
1 parent e1b1a33 commit d62d06e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public void constructor_successOidcResponse() throws IOException {
assertEquals(EXECUTABLE_SUPPORTED_MAX_VERSION, response.getVersion());
assertEquals(TOKEN_TYPE_OIDC, response.getTokenType());
assertEquals(ID_TOKEN, response.getSubjectToken());
assertTrue(
Instant.now().getEpochSecond() + EXPIRATION_DURATION == response.getExpirationTime());
assertEquals(
Instant.now().getEpochSecond() + EXPIRATION_DURATION, (long) response.getExpirationTime());
}

@Test
Expand Down Expand Up @@ -93,8 +93,8 @@ public void constructor_successSamlResponse() throws IOException {
assertEquals(EXECUTABLE_SUPPORTED_MAX_VERSION, response.getVersion());
assertEquals(TOKEN_TYPE_SAML, response.getTokenType());
assertEquals(SAML_RESPONSE, response.getSubjectToken());
assertTrue(
Instant.now().getEpochSecond() + EXPIRATION_DURATION == response.getExpirationTime());
assertEquals(
Instant.now().getEpochSecond() + EXPIRATION_DURATION, (long) response.getExpirationTime());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,8 @@ public void getExecutableResponse_oidcResponse() throws IOException, Interrupted
assertTrue(response.isSuccessful());
assertEquals(TOKEN_TYPE_OIDC, response.getTokenType());
assertEquals(ID_TOKEN, response.getSubjectToken());
assertTrue(
Instant.now().getEpochSecond() + EXPIRATION_DURATION == response.getExpirationTime());
assertEquals(
Instant.now().getEpochSecond() + EXPIRATION_DURATION, (long) response.getExpirationTime());
// Current env map should include the mappings from options.
assertEquals(4, currentEnv.size());
assertEquals(expectedMap, currentEnv);
Expand Down Expand Up @@ -788,8 +788,8 @@ public void getExecutableResponse_samlResponse() throws IOException, Interrupted
assertTrue(response.isSuccessful());
assertEquals(TOKEN_TYPE_SAML, response.getTokenType());
assertEquals(SAML_RESPONSE, response.getSubjectToken());
assertTrue(
Instant.now().getEpochSecond() + EXPIRATION_DURATION == response.getExpirationTime());
assertEquals(
Instant.now().getEpochSecond() + EXPIRATION_DURATION, (long) response.getExpirationTime());

// Current env map should include the mappings from options.
assertEquals(4, currentEnv.size());
Expand Down

0 comments on commit d62d06e

Please sign in to comment.