use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.
the class PeppolCompatibilityValidatorTest method testValidatePModeSecurityWrongX509SignatureHashFunction.
@Test
public void testValidatePModeSecurityWrongX509SignatureHashFunction() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg1().getSecurity();
aSecurityLeg.setX509SignatureHashFunction(ECryptoAlgorithmSignDigest.DIGEST_SHA_512);
m_aPMode.setLeg1(new PModeLeg(PModeLegProtocol.createForDefaultSoapVersion("http://test.example.org"), null, null, null, aSecurityLeg));
VALIDATOR.validatePMode(m_aPMode, m_aErrorList);
assertTrue(m_aErrorList.containsAny(x -> x.getErrorText(LOCALE).contains(ECryptoAlgorithmSignDigest.DIGEST_SHA_256.getID())));
}
use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.
the class PeppolCompatibilityValidatorTest method testValidatePModeSecurityWrongX509SignatureAlgorithm.
@Test
public void testValidatePModeSecurityWrongX509SignatureAlgorithm() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg1().getSecurity();
aSecurityLeg.setX509SignatureAlgorithm(ECryptoAlgorithmSign.RSA_SHA_384);
assertNotSame(ECryptoAlgorithmSign.RSA_SHA_256, aSecurityLeg.getX509SignatureAlgorithm());
m_aPMode.setLeg1(new PModeLeg(PModeLegProtocol.createForDefaultSoapVersion("http://test.example.org"), null, null, null, aSecurityLeg));
VALIDATOR.validatePMode(m_aPMode, m_aErrorList);
assertTrue(m_aErrorList.containsAny(x -> x.getErrorText(LOCALE).contains(ECryptoAlgorithmSign.RSA_SHA_256.getID())));
}
use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.
the class PeppolCompatibilityValidatorTest method testValidatePModeErrorHandlingReportDeliveryFailuresNotifyProducerWrongValue.
@Test
public void testValidatePModeErrorHandlingReportDeliveryFailuresNotifyProducerWrongValue() {
final PModeLegErrorHandling aErrorHandler = PModeLegErrorHandling.createUndefined();
aErrorHandler.setReportProcessErrorNotifyProducer(false);
m_aPMode.setLeg1(new PModeLeg(PModeLegProtocol.createForDefaultSoapVersion("http://test.example.org"), null, aErrorHandler, null, null));
VALIDATOR.validatePMode(m_aPMode, m_aErrorList);
assertTrue(m_aErrorList.containsAny(x -> x.getErrorText(LOCALE).contains("ErrorHandling.Report.ProcessErrorNotifyProducer should be 'true'")));
}
use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.
the class PeppolCompatibilityValidatorTest method testValidatePModeSecurityWrongWSSVersion.
@SuppressWarnings("deprecation")
@Test
public void testValidatePModeSecurityWrongWSSVersion() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg1().getSecurity();
aSecurityLeg.setWSSVersion(EWSSVersion.WSS_10);
m_aPMode.setLeg1(new PModeLeg(PModeLegProtocol.createForDefaultSoapVersion("http://test.example.org"), null, null, null, aSecurityLeg));
VALIDATOR.validatePMode(m_aPMode, m_aErrorList);
assertTrue(m_aErrorList.containsAny(x -> x.getErrorText(LOCALE).contains("Security.WSSVersion must use the value WSS_111 instead of WSS_10")));
}
use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.
the class PeppolCompatibilityValidatorTest method testValidatePModeSecurityNoX509EncryptionAlgorithm.
@Test
public void testValidatePModeSecurityNoX509EncryptionAlgorithm() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg1().getSecurity();
aSecurityLeg.setX509EncryptionAlgorithm(null);
m_aPMode.setLeg1(new PModeLeg(PModeLegProtocol.createForDefaultSoapVersion("http://test.example.org"), null, null, null, aSecurityLeg));
VALIDATOR.validatePMode(m_aPMode, m_aErrorList);
assertTrue(m_aErrorList.containsAny(x -> x.getErrorText(LOCALE).contains("X509EncryptionAlgorithm is missing")));
}
Aggregations