use of org.nhindirect.policy.x509.BasicContraintsExtensionField in project nhin-d by DirectProject.
the class BasicContraintsExtensionField_injectReferenceValueTest method testInjectReferenceValue_basicContraintNotExists_notRequired_assertFalse.
public void testInjectReferenceValue_basicContraintNotExists_notRequired_assertFalse() throws Exception {
final X509Certificate cert = TestUtils.loadCertificate("SESTestAccount-Signiture.der");
final BasicContraintsExtensionField field = new BasicContraintsExtensionField(false);
field.injectReferenceValue(cert);
assertFalse(field.getPolicyValue().getPolicyValue());
}
use of org.nhindirect.policy.x509.BasicContraintsExtensionField in project nhin-d by DirectProject.
the class BasicContraintsExtensionField_injectReferenceValueTest method testInjectReferenceValue_noInjection_getPolicyValue_assertException.
public void testInjectReferenceValue_noInjection_getPolicyValue_assertException() throws Exception {
final BasicContraintsExtensionField field = new BasicContraintsExtensionField(true);
boolean exceptionOccured = false;
try {
field.getPolicyValue();
} catch (IllegalStateException e) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.policy.x509.BasicContraintsExtensionField in project nhin-d by DirectProject.
the class BasicContraintsExtensionField_injectReferenceValueTest method testInjectReferenceValue_basicContraintExists_assertFalse.
public void testInjectReferenceValue_basicContraintExists_assertFalse() throws Exception {
final X509Certificate cert = TestUtils.loadCertificate("cernerdemos.der");
final BasicContraintsExtensionField field = new BasicContraintsExtensionField(false);
field.injectReferenceValue(cert);
assertFalse(field.getPolicyValue().getPolicyValue());
}
use of org.nhindirect.policy.x509.BasicContraintsExtensionField in project nhin-d by DirectProject.
the class BasicContraintsExtensionField_injectReferenceValueTest method testInjectReferenceValue_basicContraintNotExists_required_assertException.
public void testInjectReferenceValue_basicContraintNotExists_required_assertException() throws Exception {
final X509Certificate cert = TestUtils.loadCertificate("SESTestAccount-Signiture.der");
final BasicContraintsExtensionField field = new BasicContraintsExtensionField(true);
boolean exceptionOccured = false;
try {
field.injectReferenceValue(cert);
} catch (PolicyRequiredException e) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.policy.x509.BasicContraintsExtensionField in project nhin-d by DirectProject.
the class BasicContraintsExtensionField_injectReferenceValueTest method testInjectReferenceValue_basicContraintExists_assertTrue.
public void testInjectReferenceValue_basicContraintExists_assertTrue() throws Exception {
final X509Certificate cert = TestUtils.loadCertificate("msanchor.der");
final BasicContraintsExtensionField field = new BasicContraintsExtensionField(false);
field.injectReferenceValue(cert);
assertTrue(field.getPolicyValue().getPolicyValue());
}
Aggregations