Session { public Login login(URL accountLocation, KeyPair accountKeyPair) { return new Login(accountLocation, accountKeyPair, this); } Session(String serverUri);  Session(URI serverUri);  Session(URI serverUri, AcmeProvider provider); Login login(URL accountLocation, KeyPair accountKeyPair); URI getServerUri(); @Nullable String getNonce(); void setNonce(@Nullable String nonce); Locale getLocale(); void setLocale(@Nullable Locale locale); @Deprecated Proxy getProxy(); @Deprecated void setProxy(@Nullable Proxy proxy); NetworkSettings networkSettings(); AcmeProvider provider(); Connection connect(); URL resourceUrl(Resource resource); Metadata getMetadata(); @Nullable ZonedDateTime getDirectoryLastModified(); void setDirectoryLastModified(@Nullable ZonedDateTime directoryLastModified); @Nullable ZonedDateTime getDirectoryExpires(); void setDirectoryExpires(@Nullable ZonedDateTime directoryExpires); boolean hasDirectory();  }
@Test public void testLogin() throws IOException { URI serverUri = URI.create(TestUtils.ACME_SERVER_URI); URL accountLocation = url(TestUtils.ACCOUNT_URL); KeyPair accountKeyPair = TestUtils.createKeyPair(); Session session = new Session(serverUri); Login login = session.login(accountLocation, accountKeyPair); assertThat(login, is(notNullValue())); assertThat(login.getSession(), is(session)); assertThat(login.getAccountLocation(), is(accountLocation)); assertThat(login.getKeyPair(), is(accountKeyPair)); }