diff --git a/acme4j-client/src/main/java/org/shredzone/acme4j/AcmeClient.java b/acme4j-client/src/main/java/org/shredzone/acme4j/AcmeClient.java index 6b8a8dad..135d76c3 100644 --- a/acme4j-client/src/main/java/org/shredzone/acme4j/AcmeClient.java +++ b/acme4j-client/src/main/java/org/shredzone/acme4j/AcmeClient.java @@ -39,7 +39,7 @@ public interface AcmeClient { void newRegistration(Account account, Registration registration) throws AcmeException; /** - * Updates an existing account. + * Modifies an existing account. * * @param account * {@link Account} that is registered @@ -47,7 +47,7 @@ public interface AcmeClient { * {@link Registration} containing updated registration data. Set the * account location via {@link Registration#setLocation(URI)}! */ - void updateRegistration(Account account, Registration registration) throws AcmeException; + void modifyRegistration(Account account, Registration registration) throws AcmeException; /** * Creates a new {@link Authorization} for a domain. @@ -79,7 +79,7 @@ public interface AcmeClient { void updateChallenge(Challenge challenge) throws AcmeException; /** - * Restore a {@link Challenge} instance if only the challenge URI is known. It + * Restores a {@link Challenge} instance if only the challenge URI is known. It * contains the current state. * * @param challengeUri @@ -90,7 +90,7 @@ public interface AcmeClient { T restoreChallenge(URI challengeUri) throws AcmeException; /** - * Request a certificate. + * Requests a certificate. * * @param account * {@link Account} to be used for conversation diff --git a/acme4j-client/src/main/java/org/shredzone/acme4j/impl/AbstractAcmeClient.java b/acme4j-client/src/main/java/org/shredzone/acme4j/impl/AbstractAcmeClient.java index a98d5812..9b6cf648 100644 --- a/acme4j-client/src/main/java/org/shredzone/acme4j/impl/AbstractAcmeClient.java +++ b/acme4j-client/src/main/java/org/shredzone/acme4j/impl/AbstractAcmeClient.java @@ -125,7 +125,7 @@ public abstract class AbstractAcmeClient implements AcmeClient { } @Override - public void updateRegistration(Account account, Registration registration) throws AcmeException { + public void modifyRegistration(Account account, Registration registration) throws AcmeException { if (account == null) { throw new NullPointerException("account must not be null"); } @@ -136,7 +136,7 @@ public abstract class AbstractAcmeClient implements AcmeClient { throw new IllegalArgumentException("registration location must not be null. Use newRegistration() if not known."); } - LOG.debug("updateRegistration"); + LOG.debug("modifyRegistration"); try (Connection conn = createConnection()) { ClaimBuilder claims = new ClaimBuilder(); claims.putResource("reg"); diff --git a/acme4j-client/src/test/java/org/shredzone/acme4j/impl/AbstractAcmeClientTest.java b/acme4j-client/src/test/java/org/shredzone/acme4j/impl/AbstractAcmeClientTest.java index 795b7eba..732dc850 100644 --- a/acme4j-client/src/test/java/org/shredzone/acme4j/impl/AbstractAcmeClientTest.java +++ b/acme4j-client/src/test/java/org/shredzone/acme4j/impl/AbstractAcmeClientTest.java @@ -105,10 +105,10 @@ public class AbstractAcmeClientTest { } /** - * Test that a {@link Registration} can be updated. + * Test that a {@link Registration} can be modified. */ @Test - public void testUpdateRegistration() throws AcmeException { + public void testModifyRegistration() throws AcmeException { Registration registration = new Registration(); registration.setAgreement(agreementUri); registration.addContact("mailto:foo2@example.com"); @@ -118,7 +118,7 @@ public class AbstractAcmeClientTest { @Override public int sendSignedRequest(URI uri, ClaimBuilder claims, Session session, Account account) throws AcmeException { assertThat(uri, is(locationUri)); - assertThat(claims.toString(), sameJSONAs(getJson("updateRegistration"))); + assertThat(claims.toString(), sameJSONAs(getJson("modifyRegistration"))); assertThat(session, is(notNullValue())); assertThat(account, is(sameInstance(testAccount))); return HttpURLConnection.HTTP_ACCEPTED; @@ -140,7 +140,7 @@ public class AbstractAcmeClientTest { TestableAbstractAcmeClient client = new TestableAbstractAcmeClient(connection); - client.updateRegistration(testAccount, registration); + client.modifyRegistration(testAccount, registration); assertThat(registration.getLocation(), is(locationUri)); assertThat(registration.getAgreement(), is(agreementUri)); diff --git a/acme4j-client/src/test/resources/json.properties b/acme4j-client/src/test/resources/json.properties index 60407f68..07be989a 100644 --- a/acme4j-client/src/test/resources/json.properties +++ b/acme4j-client/src/test/resources/json.properties @@ -16,7 +16,7 @@ newRegistration = \ {"resource":"new-reg",\ "contact":["mailto:foo@example.com"]} -updateRegistration = \ +modifyRegistration = \ {"resource":"reg",\ "agreement":"http://example.com/agreement.pdf",\ "contact":["mailto:foo2@example.com"]} diff --git a/acme4j-example/src/main/java/org/shredzone/acme4j/ClientTest.java b/acme4j-example/src/main/java/org/shredzone/acme4j/ClientTest.java index 44a9900d..fb873f49 100644 --- a/acme4j-example/src/main/java/org/shredzone/acme4j/ClientTest.java +++ b/acme4j-example/src/main/java/org/shredzone/acme4j/ClientTest.java @@ -234,7 +234,7 @@ public class ClientTest { return false; } - client.updateRegistration(account, reg); + client.modifyRegistration(account, reg); LOG.info("Updated user's T&C"); return true; diff --git a/src/site/markdown/usage/register.md b/src/site/markdown/usage/register.md index 6c4074c5..25c48db7 100644 --- a/src/site/markdown/usage/register.md +++ b/src/site/markdown/usage/register.md @@ -35,5 +35,5 @@ Registration reg = new Registration(); reg.setLocation(accountLocationUri); reg.setAgreement(agreementUri); -client.updateRegistration(account, reg); +client.modifyRegistration(account, reg); ```