Skip to content

Commit

Permalink
Spell error fix tsaDigestAlt -> tsaDigestAlg
Browse files Browse the repository at this point in the history
The spelling error "tsaDigestAlt" was introduced in the scope of MJARSIGNER-74
  • Loading branch information
schedin authored and slawekjaranowski committed Sep 5, 2024
1 parent 19f7d88 commit beaf717
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ private void updateJarSignerRequestWithTsa(JarSignerSignRequest request, TsaServ
request.setTsaLocation(tsaServer.getTsaUrl());
request.setTsaAlias(tsaServer.getTsaAlias());
request.setTsapolicyid(tsaServer.getTsaPolicyId());
request.setTsadigestalg(tsaServer.getTsaDigestAlt());
request.setTsadigestalg(tsaServer.getTsaDigestAlg());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ static class TsaServer {
private final String tsaUrl;
private final String tsaAlias;
private final String tsaPolicyId;
private final String tsaDigestAlt;
private final String tsaDigestAlg;

private TsaServer(String tsaUrl, String tsaAlias, String tsaPolicyId, String tsaDigestAlt) {
private TsaServer(String tsaUrl, String tsaAlias, String tsaPolicyId, String tsaDigestAlg) {
this.tsaUrl = tsaUrl;
this.tsaAlias = tsaAlias;
this.tsaPolicyId = tsaPolicyId;
this.tsaDigestAlt = tsaDigestAlt;
this.tsaDigestAlg = tsaDigestAlg;
}

String getTsaUrl() {
Expand All @@ -133,8 +133,8 @@ String getTsaPolicyId() {
return tsaPolicyId;
}

String getTsaDigestAlt() {
return tsaDigestAlt;
String getTsaDigestAlg() {
return tsaDigestAlg;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ public void testNullInit() {
assertNull(tsaServer.getTsaUrl());
assertNull(tsaServer.getTsaAlias());
assertNull(tsaServer.getTsaPolicyId());
assertNull(tsaServer.getTsaDigestAlt());
assertNull(tsaServer.getTsaDigestAlg());

// Make sure "next" server also contains null values
tsaServer = tsaSelector.getServer();
assertNull(tsaServer.getTsaUrl());
assertNull(tsaServer.getTsaAlias());
assertNull(tsaServer.getTsaPolicyId());
assertNull(tsaServer.getTsaDigestAlt());
assertNull(tsaServer.getTsaDigestAlg());
}

@Test
Expand All @@ -62,22 +62,22 @@ public void testFailureCount() {
assertEquals("http://url1.com", tsaServer.getTsaUrl());
assertNull(tsaServer.getTsaAlias());
assertNull(tsaServer.getTsaPolicyId());
assertNull(tsaServer.getTsaDigestAlt());
assertNull(tsaServer.getTsaDigestAlg());

tsaSelector.registerFailure();

tsaServer = tsaSelector.getServer();
assertEquals("http://url2.com", tsaServer.getTsaUrl());
assertNull(tsaServer.getTsaAlias());
assertNull(tsaServer.getTsaPolicyId());
assertNull(tsaServer.getTsaDigestAlt());
assertNull(tsaServer.getTsaDigestAlg());

// Should get same server again
tsaServer = tsaSelector.getServer();
assertEquals("http://url2.com", tsaServer.getTsaUrl());
assertNull(tsaServer.getTsaAlias());
assertNull(tsaServer.getTsaPolicyId());
assertNull(tsaServer.getTsaDigestAlt());
assertNull(tsaServer.getTsaDigestAlg());
}

@Test(timeout = 30000)
Expand Down Expand Up @@ -135,15 +135,15 @@ public void testDigestAlgoritm() {
assertEquals("http://url1.com", tsaServer.getTsaUrl());
assertNull(tsaServer.getTsaAlias());
assertNull(tsaServer.getTsaPolicyId());
assertEquals("SHA-512", tsaServer.getTsaDigestAlt());
assertEquals("SHA-512", tsaServer.getTsaDigestAlg());

// Make sure that the next URL has the same digest algorithm
tsaSelector.registerFailure();
tsaServer = tsaSelector.getServer();
assertEquals("http://url2.com", tsaServer.getTsaUrl());
assertNull(tsaServer.getTsaAlias());
assertNull(tsaServer.getTsaPolicyId());
assertEquals("SHA-512", tsaServer.getTsaDigestAlt());
assertEquals("SHA-512", tsaServer.getTsaDigestAlg());
}

@Test
Expand Down Expand Up @@ -172,6 +172,6 @@ public void testFailureRegistrationWithoutCurrent() {
assertEquals("http://url1.com", tsaServer.getTsaUrl());
assertEquals("alias1", tsaServer.getTsaAlias());
assertEquals("1.1", tsaServer.getTsaPolicyId());
assertEquals("SHA-384", tsaServer.getTsaDigestAlt());
assertEquals("SHA-384", tsaServer.getTsaDigestAlg());
}
}

0 comments on commit beaf717

Please sign in to comment.