Search in sources :

Example 1 with Communication

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();
}
Also used : Company(eu.ggnet.dwoss.customer.ee.entity.Company) Customer(eu.ggnet.dwoss.customer.ee.entity.Customer) MandatorMetadata(eu.ggnet.dwoss.customer.ee.entity.MandatorMetadata) Contact(eu.ggnet.dwoss.customer.ee.entity.Contact) Communication(eu.ggnet.dwoss.customer.ee.entity.Communication) Test(org.junit.Test)

Example 2 with Communication

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();
}
Also used : Communication(eu.ggnet.dwoss.customer.ee.entity.Communication) Test(org.junit.Test)

Example 3 with Communication

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();
}
Also used : Communication(eu.ggnet.dwoss.customer.ee.entity.Communication) Test(org.junit.Test)

Example 4 with Communication

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();
}
Also used : Communication(eu.ggnet.dwoss.customer.ee.entity.Communication) Test(org.junit.Test)

Example 5 with Communication

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();
}
Also used : Communication(eu.ggnet.dwoss.customer.ee.entity.Communication) Test(org.junit.Test)

Aggregations

Communication (eu.ggnet.dwoss.customer.ee.entity.Communication)10 Test (org.junit.Test)6 Company (eu.ggnet.dwoss.customer.ee.entity.Company)1 Contact (eu.ggnet.dwoss.customer.ee.entity.Contact)1 Customer (eu.ggnet.dwoss.customer.ee.entity.Customer)1 MandatorMetadata (eu.ggnet.dwoss.customer.ee.entity.MandatorMetadata)1 SimpleCustomer (eu.ggnet.dwoss.customer.ee.entity.dto.SimpleCustomer)1 JButton (javax.swing.JButton)1 JPanel (javax.swing.JPanel)1