use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.
the class CEFCompatibilityValidatorTwoWayFuncTest method testValidatePModeSecurityWrongX509EncryptionAlgorithm.
@Test
public void testValidatePModeSecurityWrongX509EncryptionAlgorithm() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg2().getSecurity();
aSecurityLeg.setX509EncryptionAlgorithm(ECryptoAlgorithmCrypt.AES_192_CBC);
m_aPMode.setLeg2(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(ECryptoAlgorithmCrypt.AES_128_GCM.getID())));
}
use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.
the class CEFCompatibilityValidatorTwoWayFuncTest method testValidatePModeErrorHandlingReportProcessErrorNotifyConsumerMandatory.
@Test
public void testValidatePModeErrorHandlingReportProcessErrorNotifyConsumerMandatory() {
final PModeLegErrorHandling aErrorHandler = PModeLegErrorHandling.createUndefined();
m_aPMode.setLeg2(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.ProcessErrorNotifyConsumer is missing")));
}
use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.
the class CEFCompatibilityValidatorTwoWayFuncTest method testValidatePModeSecurityNoX509SignatureCertificate.
@Test
@Ignore("The X509 certificate is always null, as it is received from the SMP")
public void testValidatePModeSecurityNoX509SignatureCertificate() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg2().getSecurity();
aSecurityLeg.setX509SignatureCertificate(null);
m_aPMode.setLeg2(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("X509SignatureCertificate is missing")));
}
use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.
the class CEFCompatibilityValidatorTwoWayFuncTest method testValidatePModeProtocolAddressIsNotHttp.
@Test
public void testValidatePModeProtocolAddressIsNotHttp() {
m_aPMode.setLeg2(new PModeLeg(PModeLegProtocol.createForDefaultSoapVersion("ftp://test.com"), null, null, null, null));
VALIDATOR.validatePMode(m_aPMode, m_aErrorList);
assertTrue(m_aErrorList.containsAny(x -> x.getErrorText(LOCALE).contains("AddressProtocol 'ftp' is unsupported")));
}
use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.
the class CEFCompatibilityValidatorTwoWayFuncTest method testValidatePModeSecurityPModeAuthorizeTrue.
@Test
public void testValidatePModeSecurityPModeAuthorizeTrue() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg2().getSecurity();
aSecurityLeg.setPModeAuthorize(true);
m_aPMode.setLeg2(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("false")));
}
Aggregations