@Test
public void testInvalidUsernameTokenParameters() {

	PMode invalidPMode = new PMode();
	
	invalidPMode.setMep(EbMSConstants.ONE_WAY_MEP);
    invalidPMode.setMepBinding(EbMSConstants.ONE_WAY_PUSH);
    invalidPMode.addLeg(new Leg());
    assertTrue(Utils.isNullOrEmpty(validator.validatePMode(invalidPMode)));
    PartnerConfig initiator = new PartnerConfig();
    SecurityConfig secConfig = new SecurityConfig();
    SigningConfig sigConfig = new SigningConfig();
    sigConfig.setKeystoreAlias("exampleca");
    secConfig.setSignatureConfiguration(sigConfig);
    EncryptionConfig encConfig = new EncryptionConfig();
    encConfig.setKeystoreAlias("partya");
    secConfig.setEncryptionConfiguration(encConfig);
    initiator.setSecurityConfiguration(secConfig);
    invalidPMode.setInitiator(initiator);
    UsernameTokenConfig tokenConfig = new UsernameTokenConfig();
    assertTrue(Utils.isNullOrEmpty(tokenConfig.getUsername()));
    // non null empty token with default header
    secConfig.setUsernameTokenConfiguration(
            SecurityHeaderTarget.DEFAULT, tokenConfig);
    assertFalse(Utils.isNullOrEmpty(validator.validatePMode(invalidPMode)));
    tokenConfig.setUsername("username");
    tokenConfig.setPassword("secret");
    assertTrue(Utils.isNullOrEmpty(validator.validatePMode(invalidPMode)));
    tokenConfig = new UsernameTokenConfig();
    // non null empty token with EBMS header
    secConfig.setUsernameTokenConfiguration(
            SecurityHeaderTarget.EBMS, tokenConfig);
    assertFalse(Utils.isNullOrEmpty(validator.validatePMode(invalidPMode)));
}