use of eu.ggnet.dwoss.customer.ee.entity.Communication in project dwoss by gg-net.
the class PersistenceIT method testPersistence.
@Test
public void testPersistence() throws Exception {
utx.begin();
em.joinTransaction();
Customer c = GEN.makeCustomer();
em.persist(c);
utx.commit();
utx.begin();
em.joinTransaction();
CriteriaQuery<Customer> customerQ = em.getCriteriaBuilder().createQuery(Customer.class);
c = em.createQuery(customerQ.select(customerQ.from(Customer.class))).getSingleResult();
assertThat(c.getContacts()).describedAs("customer.getContacts()").isNotEmpty();
L.info("{}", c);
L.info("===== Contacts");
for (Contact contact : c.getContacts()) {
L.info(contact.toString());
L.info("===== - Communications");
for (Communication communication : contact.getCommunications()) {
L.info(communication.toString());
}
}
L.info("===== Companies");
for (Company company : c.getCompanies()) {
L.info(company.toString());
L.info("===== - Communications:");
for (Communication communication : company.getCommunications()) {
L.info(communication.toString());
}
}
L.info("===== MandatorMetaData");
for (MandatorMetadata man : c.getMandatorMetadata()) {
L.info(man.toString());
}
utx.commit();
}
use of eu.ggnet.dwoss.customer.ee.entity.Communication in project dwoss by gg-net.
the class CommunicationTest method testValidEmail.
@Test
public void testValidEmail() {
Communication makeValidCommunication = makeValidCommunication();
makeValidCommunication.setType(EMAIL);
makeValidCommunication.setIdentifier("test@test.de");
assertThat(makeValidCommunication.getViolationMessage()).as("Communication have a vaild email").isNull();
}
use of eu.ggnet.dwoss.customer.ee.entity.Communication in project dwoss by gg-net.
the class CommunicationTest method testValidMessage.
@Test
public void testValidMessage() {
Communication makeValidCommunication = makeValidCommunication();
assertThat(makeValidCommunication.getViolationMessage()).as("Communication with valid values").isNull();
}
use of eu.ggnet.dwoss.customer.ee.entity.Communication in project dwoss by gg-net.
the class CommunicationTest method testNonValidEmail.
@Test
public void testNonValidEmail() {
Communication makeInvalidCommunication = makeValidCommunication();
makeInvalidCommunication.setType(EMAIL);
makeInvalidCommunication.setIdentifier("falscheemail@@test.de");
assertThat(makeInvalidCommunication.getViolationMessage()).as("Communication with nonvalid email").isNotBlank();
}
use of eu.ggnet.dwoss.customer.ee.entity.Communication in project dwoss by gg-net.
the class CommunicationTest method testNonValidPhonenumber.
@Test
public void testNonValidPhonenumber() {
Communication makeInvalidCommunication = makeValidCommunication();
makeInvalidCommunication.setType(PHONE);
makeInvalidCommunication.setIdentifier("0123586Buchstaben");
assertThat(makeInvalidCommunication.getViolationMessage()).as("Communication with nonvalid phonenumber").isNotBlank();
}
Aggregations