mirror of https://github.com/shred/acme4j
Add support for draft-aaron-acme-profiles
parent
c7e6d3169c
commit
c7ec1d933e
|
@ -437,6 +437,16 @@ public class Order extends AcmeJsonResource implements PollableResource {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the selected profile.
|
||||||
|
*
|
||||||
|
* @since 2.3
|
||||||
|
* @throws AcmeNotSupportedException if profile is not supported
|
||||||
|
*/
|
||||||
|
public String getProfile() {
|
||||||
|
return getJSON().getFeature("profile").toString();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void invalidate() {
|
protected void invalidate() {
|
||||||
super.invalidate();
|
super.invalidate();
|
||||||
|
|
|
@ -116,6 +116,8 @@ public class OrderBuilderTest {
|
||||||
.isThrownBy(order::getAutoRenewalLifetimeAdjust);
|
.isThrownBy(order::getAutoRenewalLifetimeAdjust);
|
||||||
softly.assertThatExceptionOfType(AcmeNotSupportedException.class)
|
softly.assertThatExceptionOfType(AcmeNotSupportedException.class)
|
||||||
.isThrownBy(order::isAutoRenewalGetEnabled);
|
.isThrownBy(order::isAutoRenewalGetEnabled);
|
||||||
|
softly.assertThatExceptionOfType(AcmeNotSupportedException.class)
|
||||||
|
.isThrownBy(order::getProfile);
|
||||||
softly.assertThat(order.getLocation()).isEqualTo(locationUrl);
|
softly.assertThat(order.getLocation()).isEqualTo(locationUrl);
|
||||||
softly.assertThat(order.getAuthorizations()).isNotNull();
|
softly.assertThat(order.getAuthorizations()).isNotNull();
|
||||||
softly.assertThat(order.getAuthorizations()).hasSize(2);
|
softly.assertThat(order.getAuthorizations()).hasSize(2);
|
||||||
|
@ -369,11 +371,16 @@ public class OrderBuilderTest {
|
||||||
provider.putTestResource(Resource.NEW_ORDER, resourceUrl);
|
provider.putTestResource(Resource.NEW_ORDER, resourceUrl);
|
||||||
|
|
||||||
var account = new Account(login);
|
var account = new Account(login);
|
||||||
account.newOrder()
|
var order = account.newOrder()
|
||||||
.domain("example.org")
|
.domain("example.org")
|
||||||
.profile("classic")
|
.profile("classic")
|
||||||
.create();
|
.create();
|
||||||
|
|
||||||
|
try (var softly = new AutoCloseableSoftAssertions()) {
|
||||||
|
softly.assertThat(order.getProfile()).isEqualTo("classic");
|
||||||
|
}
|
||||||
|
|
||||||
|
provider.close();
|
||||||
provider.close();
|
provider.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,8 @@ public class OrderTest {
|
||||||
.isThrownBy(order::getAutoRenewalLifetimeAdjust);
|
.isThrownBy(order::getAutoRenewalLifetimeAdjust);
|
||||||
softly.assertThatExceptionOfType(AcmeNotSupportedException.class)
|
softly.assertThatExceptionOfType(AcmeNotSupportedException.class)
|
||||||
.isThrownBy(order::isAutoRenewalGetEnabled);
|
.isThrownBy(order::isAutoRenewalGetEnabled);
|
||||||
|
softly.assertThatExceptionOfType(AcmeNotSupportedException.class)
|
||||||
|
.isThrownBy(order::getProfile);
|
||||||
|
|
||||||
softly.assertThat(order.getError()).isNotEmpty();
|
softly.assertThat(order.getError()).isNotEmpty();
|
||||||
softly.assertThat(order.getError().orElseThrow().getType())
|
softly.assertThat(order.getError().orElseThrow().getType())
|
||||||
|
|
Loading…
Reference in New Issue