use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.
the class CEFCompatibilityValidatorTest 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.getLeg1().getSecurity();
aSecurityLeg.setX509SignatureCertificate(null);
m_aPMode.setLeg1(new PModeLeg(PModeLegProtocol.createForDefaultSoapVersion("http://test.example.org"), null, PModeLegErrorHandling.createUndefined(), 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 CEFCompatibilityValidatorTest method testValidatePModeProtocolAddressIsNotHttp.
@Test
public void testValidatePModeProtocolAddressIsNotHttp() {
m_aPMode.setLeg1(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 CEFCompatibilityValidatorTest method testValidatePModeErrorHandlingReportAsResponseWrongValue.
@Test
public void testValidatePModeErrorHandlingReportAsResponseWrongValue() {
final PModeLegErrorHandling aErrorHandler = PModeLegErrorHandling.createUndefined();
aErrorHandler.setReportAsResponse(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.AsResponse must be 'true'")));
}
use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.
the class CEFCompatibilityValidatorTest method testValidatePModeSecurityPModeAuthorizeTrue.
@Test
public void testValidatePModeSecurityPModeAuthorizeTrue() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg1().getSecurity();
aSecurityLeg.setPModeAuthorize(true);
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("false")));
}
use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.
the class CEFCompatibilityValidatorTest method testValidatePModeSecurityWrongX509EncryptionAlgorithm.
@Test
public void testValidatePModeSecurityWrongX509EncryptionAlgorithm() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg1().getSecurity();
aSecurityLeg.setX509EncryptionAlgorithm(ECryptoAlgorithmCrypt.AES_192_CBC);
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(ECryptoAlgorithmCrypt.AES_128_GCM.getID())));
}
Aggregations