use of com.helger.phase4.model.pmode.leg.PModeLegSecurity in project phase4 by phax.
the class DefaultPMode method _generatePModeLeg.
@Nonnull
private static PModeLeg _generatePModeLeg(@Nullable final String sAddress) {
final PModeLegErrorHandling aErrorHandling = PModeLegErrorHandling.createUndefined();
aErrorHandling.setReportAsResponse(true);
final PModeLegReliability aReliability = null;
final PModeLegSecurity aSecurity = new PModeLegSecurity();
aSecurity.setSendReceipt(true);
aSecurity.setSendReceiptReplyPattern(EPModeSendReceiptReplyPattern.RESPONSE);
return new PModeLeg(_generatePModeLegProtocol(sAddress), _generatePModeLegBusinessInformation(), aErrorHandling, aReliability, aSecurity);
}
use of com.helger.phase4.model.pmode.leg.PModeLegSecurity in project phase4 by phax.
the class ENTSOGCompatibilityValidatorTest method testValidatePModeSecurityNoX509SignatureAlgorithm.
@Test
public void testValidatePModeSecurityNoX509SignatureAlgorithm() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg1().getSecurity();
aSecurityLeg.setX509SignatureAlgorithm(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("X509SignatureAlgorithm is missing")));
}
use of com.helger.phase4.model.pmode.leg.PModeLegSecurity in project phase4 by phax.
the class ENTSOGCompatibilityValidatorTest 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 ENTSOGCompatibilityValidatorTest 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 ENTSOGCompatibilityValidatorTest method testValidatePModeSecurityNoX509SignatureHashFunction.
@Test
public void testValidatePModeSecurityNoX509SignatureHashFunction() {
final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg1().getSecurity();
aSecurityLeg.setX509SignatureHashFunction(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("X509SignatureHashFunction is missing")));
}
Aggregations