mirror of https://github.com/shred/acme4j
Constructor for creating a Registration with a location URI
parent
db927300e9
commit
f4cd15da65
|
@ -28,6 +28,20 @@ public class Registration {
|
|||
private URI agreement;
|
||||
private URI location;
|
||||
|
||||
/**
|
||||
* Create an empty {@link Registration}.
|
||||
*/
|
||||
public Registration() {
|
||||
// default constructor
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link Registration} for the given location URI.
|
||||
*/
|
||||
public Registration(URI location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the URI of the agreement document the user is required to accept.
|
||||
*/
|
||||
|
|
|
@ -49,4 +49,16 @@ public class RegistrationTest {
|
|||
assertThat(registration.getContacts(), contains("mailto:foo@example.com", "mailto:bar@example.com"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test constructors;
|
||||
*/
|
||||
@Test
|
||||
public void testConstructor() throws URISyntaxException {
|
||||
Registration registration1 = new Registration();
|
||||
assertThat(registration1.getLocation(), is(nullValue()));
|
||||
|
||||
Registration registration2 = new Registration(new URI("http://example.com/acme/12345"));
|
||||
assertThat(registration2.getLocation(), is(new URI("http://example.com/acme/12345")));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue