Skip to content

Commit

Permalink
tests: remove visibilty modifier from class, use idiomatic order of a…
Browse files Browse the repository at this point in the history
…rguments in assert calls
  • Loading branch information
lrosenfeldt committed Aug 7, 2024
1 parent edb085b commit 406428d
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.util.Base64;
import java.util.Date;

public class RequestHeaderGeneratorTest {
class RequestHeaderGeneratorTest {
private static final String TEST_KEY = "KEY";
private static final String TEST_SECRET = "Super duper Ethan Hunt level secret";
private static final CommunicatorConfiguration CONFIG = new CommunicatorConfiguration(TEST_KEY, TEST_SECRET,
Expand Down Expand Up @@ -51,8 +51,9 @@ void testSignatureGenerationForGet() {
try {
Request updatedRequest = HEADER_GENERATOR.generateAdditionalRequestHeaders(request);

assertEquals(updatedRequest.header("Authorization"),
"GCS v1HMAC:KEY:ZSq7H19dyhyNGSPY5UgyPwITc5n4QG+zHnNDExIa6A8=");
assertEquals(
"GCS v1HMAC:KEY:ZSq7H19dyhyNGSPY5UgyPwITc5n4QG+zHnNDExIa6A8=",
updatedRequest.header("Authorization"));
} catch (Exception e) {
fail(e);
}
Expand All @@ -78,8 +79,8 @@ void testSignatureGenerationWithContentType() {
try {
Request updatedRequest = HEADER_GENERATOR.generateAdditionalRequestHeaders(request);

assertEquals(updatedRequest.header("Authorization"),
"GCS v1HMAC:KEY:c5aNDw4AUxRChugRyN0OmTCs38YLA9E/tR+k0bOQzyk=");
assertEquals("GCS v1HMAC:KEY:c5aNDw4AUxRChugRyN0OmTCs38YLA9E/tR+k0bOQzyk=",
updatedRequest.header("Authorization"));
} catch (Exception e) {
fail(e);
}
Expand All @@ -96,7 +97,7 @@ void addADateHeaderIfMissingTest() {
Request updatedRequest = HEADER_GENERATOR.generateAdditionalRequestHeaders(request);

assertNotNull(updatedRequest.headers().get("Date"));
assertNotEquals(updatedRequest.headers().get("Date"), "");
assertNotEquals("", updatedRequest.headers().get("Date"));
} catch (Exception e) {
fail(e);
}
Expand Down Expand Up @@ -140,7 +141,7 @@ void addServerClientInfoIfMissingTest() {
assertNotNull(clientMetaInfo);

String metaInfoAsJson = new String(Base64.getDecoder().decode(clientMetaInfo), StandardCharsets.UTF_8);
assertEquals(metaInfoAsJson, "\"[]\"");
assertEquals("\"[]\"", metaInfoAsJson);
} catch (Exception e) {
fail(e);
}
Expand Down

0 comments on commit 406428d

Please sign in to comment.