use of com.helger.phase4.model.pmode.leg.PModeLegSecurity in project phase4 by phax.
the class CEFCompatibilityValidatorTest 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.PModeLegSecurity in project phase4 by phax.
the class CEFCompatibilityValidatorTest 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.PModeLegSecurity in project phase4 by phax.
the class CEFCompatibilityValidatorTest 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")));
}
use of com.helger.phase4.model.pmode.leg.PModeLegSecurity in project phase4 by phax.
the class CEFCompatibilityValidatorTwoWayFuncTest method testValidatePModeSecurityResponsePatternWrongBoolean.
@Test
public void testValidatePModeSecurityResponsePatternWrongBoolean() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg2().getSecurity();
aSecurityLeg.setSendReceipt(true);
aSecurityLeg.setSendReceiptReplyPattern(EPModeSendReceiptReplyPattern.CALLBACK);
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("Security.SendReceiptReplyPattern must use the value RESPONSE instead of CALLBACK")));
}
use of com.helger.phase4.model.pmode.leg.PModeLegSecurity in project phase4 by phax.
the class CEFCompatibilityValidatorTwoWayFuncTest method testValidatePModeSecurityNoX509EncryptionAlgorithm.
@Test
public void testValidatePModeSecurityNoX509EncryptionAlgorithm() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg2().getSecurity();
aSecurityLeg.setX509EncryptionAlgorithm(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("X509EncryptionAlgorithm is missing")));
}
Aggregations