Search in sources :

Example 1 with CMConfiguration

use of org.apache.camel.component.cm.CMConfiguration in project camel by apache.

the class CMConfigurationTest method testNullProductToken.

// @After
// public void afterTest() {
@Test
public void testNullProductToken() throws Exception {
    final CMConfiguration configuration = new CMConfiguration();
    // length: 1-11
    configuration.setDefaultFrom("DefaultFrom");
    configuration.setProductToken(null);
    configuration.setDefaultMaxNumberOfParts(8);
    configuration.setTestConnectionOnStartup(false);
    final Set<ConstraintViolation<CMConfiguration>> constraintViolations = validator.validate(configuration);
    Assert.isTrue(1 == constraintViolations.size());
}
Also used : ConstraintViolation(javax.validation.ConstraintViolation) CMConfiguration(org.apache.camel.component.cm.CMConfiguration) Test(org.junit.Test)

Example 2 with CMConfiguration

use of org.apache.camel.component.cm.CMConfiguration in project camel by apache.

the class CMConfigurationTest method testMaxNumberOfParts.

@Test
public void testMaxNumberOfParts() throws Exception {
    final CMConfiguration configuration = new CMConfiguration();
    configuration.setProductToken(UUID.randomUUID().toString());
    configuration.setDefaultFrom("DefaultFrom");
    configuration.setDefaultMaxNumberOfParts(9);
    configuration.setTestConnectionOnStartup(false);
    final Set<ConstraintViolation<CMConfiguration>> constraintViolations = validator.validate(configuration);
    Assert.isTrue(1 == constraintViolations.size());
}
Also used : ConstraintViolation(javax.validation.ConstraintViolation) CMConfiguration(org.apache.camel.component.cm.CMConfiguration) Test(org.junit.Test)

Example 3 with CMConfiguration

use of org.apache.camel.component.cm.CMConfiguration in project camel by apache.

the class CMConfigurationTest method testDefaultFromFieldZeroLength.

@Test
public void testDefaultFromFieldZeroLength() throws Exception {
    final CMConfiguration configuration = new CMConfiguration();
    // length: 1-11
    configuration.setDefaultFrom("");
    configuration.setProductToken(UUID.randomUUID().toString());
    configuration.setDefaultMaxNumberOfParts(8);
    configuration.setTestConnectionOnStartup(false);
    final Set<ConstraintViolation<CMConfiguration>> constraintViolations = validator.validate(configuration);
    Assert.isTrue(1 == constraintViolations.size());
}
Also used : ConstraintViolation(javax.validation.ConstraintViolation) CMConfiguration(org.apache.camel.component.cm.CMConfiguration) Test(org.junit.Test)

Example 4 with CMConfiguration

use of org.apache.camel.component.cm.CMConfiguration in project camel by apache.

the class CMConfigurationTest method testNullDefaultFrom.

@Test
public void testNullDefaultFrom() throws Exception {
    final CMConfiguration configuration = new CMConfiguration();
    // length: 1-11
    configuration.setDefaultFrom(null);
    configuration.setProductToken(UUID.randomUUID().toString());
    configuration.setDefaultMaxNumberOfParts(8);
    configuration.setTestConnectionOnStartup(false);
    final Set<ConstraintViolation<CMConfiguration>> constraintViolations = validator.validate(configuration);
    Assert.isTrue(1 == constraintViolations.size());
}
Also used : ConstraintViolation(javax.validation.ConstraintViolation) CMConfiguration(org.apache.camel.component.cm.CMConfiguration) Test(org.junit.Test)

Example 5 with CMConfiguration

use of org.apache.camel.component.cm.CMConfiguration in project camel by apache.

the class CMConfigurationTest method testDefaultFromFieldMaxLength.

@Test
public void testDefaultFromFieldMaxLength() throws Exception {
    final CMConfiguration configuration = new CMConfiguration();
    // length: 1-11
    configuration.setDefaultFrom("123456789012");
    configuration.setProductToken(UUID.randomUUID().toString());
    configuration.setDefaultMaxNumberOfParts(8);
    configuration.setTestConnectionOnStartup(false);
    final Set<ConstraintViolation<CMConfiguration>> constraintViolations = validator.validate(configuration);
    Assert.isTrue(1 == constraintViolations.size());
}
Also used : ConstraintViolation(javax.validation.ConstraintViolation) CMConfiguration(org.apache.camel.component.cm.CMConfiguration) Test(org.junit.Test)

Aggregations

ConstraintViolation (javax.validation.ConstraintViolation)6 CMConfiguration (org.apache.camel.component.cm.CMConfiguration)6 Test (org.junit.Test)6