Remove account parameter where not used

pull/17/merge
Richard Körber 2015-12-20 12:39:44 +01:00
parent f4cd15da65
commit 6b1797c453
4 changed files with 7 additions and 11 deletions

View File

@ -73,25 +73,21 @@ public interface AcmeClient {
/** /**
* Updates the {@link Challenge} instance. It contains the current state. * Updates the {@link Challenge} instance. It contains the current state.
* *
* @param account
* {@link Account} to be used for conversation
* @param challenge * @param challenge
* {@link Challenge} to update * {@link Challenge} to update
*/ */
void updateChallenge(Account account, Challenge challenge) throws AcmeException; void updateChallenge(Challenge challenge) throws AcmeException;
/** /**
* Restore a {@link Challenge} instance if only the challenge URI is known. It * Restore a {@link Challenge} instance if only the challenge URI is known. It
* contains the current state. * contains the current state.
* *
* @param account
* {@link Account} to be used for conversation
* @param challengeUri * @param challengeUri
* {@link URI} of the challenge to restore * {@link URI} of the challenge to restore
* @throws ClassCastException * @throws ClassCastException
* if the challenge does not match the desired type * if the challenge does not match the desired type
*/ */
<T extends Challenge> T restoreChallenge(Account account, URI challengeUri) throws AcmeException; <T extends Challenge> T restoreChallenge(URI challengeUri) throws AcmeException;
/** /**
* Request a certificate. * Request a certificate.

View File

@ -212,7 +212,7 @@ public abstract class AbstractAcmeClient implements AcmeClient {
} }
@Override @Override
public void updateChallenge(Account account, Challenge challenge) throws AcmeException { public void updateChallenge(Challenge challenge) throws AcmeException {
LOG.debug("updateChallenge"); LOG.debug("updateChallenge");
try (Connection conn = createConnection()) { try (Connection conn = createConnection()) {
int rc = conn.sendRequest(challenge.getLocation()); int rc = conn.sendRequest(challenge.getLocation());
@ -226,7 +226,7 @@ public abstract class AbstractAcmeClient implements AcmeClient {
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public <T extends Challenge> T restoreChallenge(Account account, URI challengeUri) throws AcmeException { public <T extends Challenge> T restoreChallenge(URI challengeUri) throws AcmeException {
LOG.debug("restoreChallenge"); LOG.debug("restoreChallenge");
try (Connection conn = createConnection()) { try (Connection conn = createConnection()) {
int rc = conn.sendRequest(challengeUri); int rc = conn.sendRequest(challengeUri);

View File

@ -250,7 +250,7 @@ public class AbstractAcmeClientTest {
Challenge challenge = new HttpChallenge(); Challenge challenge = new HttpChallenge();
challenge.unmarshall(getJsonAsMap("triggerHttpChallengeResponse")); challenge.unmarshall(getJsonAsMap("triggerHttpChallengeResponse"));
client.updateChallenge(testAccount, challenge); client.updateChallenge(challenge);
assertThat(challenge.getStatus(), is(Status.VALID)); assertThat(challenge.getStatus(), is(Status.VALID));
assertThat(challenge.getLocation(), is(locationUri)); assertThat(challenge.getLocation(), is(locationUri));
@ -274,7 +274,7 @@ public class AbstractAcmeClientTest {
TestableAbstractAcmeClient client = new TestableAbstractAcmeClient(connection); TestableAbstractAcmeClient client = new TestableAbstractAcmeClient(connection);
client.putTestChallenge(HttpChallenge.TYPE, new HttpChallenge()); client.putTestChallenge(HttpChallenge.TYPE, new HttpChallenge());
Challenge challenge = client.restoreChallenge(testAccount, locationUri); Challenge challenge = client.restoreChallenge(locationUri);
assertThat(challenge.getStatus(), is(Status.VALID)); assertThat(challenge.getStatus(), is(Status.VALID));
assertThat(challenge.getLocation(), is(locationUri)); assertThat(challenge.getLocation(), is(locationUri));

View File

@ -148,7 +148,7 @@ public class ClientTest {
} catch (InterruptedException ex) { } catch (InterruptedException ex) {
LOG.warn("interrupted", ex); LOG.warn("interrupted", ex);
} }
client.updateChallenge(account, challenge); client.updateChallenge(challenge);
} }
if (attempts == 0) { if (attempts == 0) {
LOG.error("Failed to pass the challenge... Giving up."); LOG.error("Failed to pass the challenge... Giving up.");