@@ -0,0 +1,2690 @@
+package net.contargo.types.contactinfo.validation;%0A%0Aimport net.contargo.types.contactinfo.ContactInformation;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport static org.junit.Assert.*;%0Aimport static org.mockito.Matchers.any;%0Aimport static org.mockito.Matchers.isA;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class AggregatingContactInfoValidationServiceTest %7B%0A%0A    @Mock%0A    private CompletenessValidator completenessValidator;%0A%0A    @Mock%0A    private UniquenessValidator uniquenessValidator;%0A%0A    @Test%0A    public void ensureThatCompletenessAndUniquenessValidatorsAreCalled() %7B%0A        ContactInformation contactInformation = new ContactInformation(%22userUUID%22, %22mobile%22, %22phone%22, %22email%22, %22communicationEmail%22);%0A        AggregatingContactInfoValidationService sut = new AggregatingContactInfoValidationService(uniquenessValidator, completenessValidator);%0A        sut.validate(contactInformation);%0A        verify(completenessValidator).checkCompleteness(isA(ContactInformation.class));%0A        verify(uniquenessValidator).checkUniqueness(isA(ContactInformation.class));%0A    %7D%0A%0A    @Test%0A    public void ensureThatValidationResultsAreAggregated() %7B%0A        ContactInformation contactInformation = new ContactInformation(%22userUUID%22, %22mobile%22, %22phone%22, %22email%22, %22communicationEmail%22);%0A        AggregatingContactInfoValidationService sut = new AggregatingContactInfoValidationService(uniquenessValidator, completenessValidator);%0A        List%3CValidationResult%3E validationResults1 = new ArrayList%3C%3E();%0A        validationResults1.add(ValidationResult.MISSING_MOBILE);%0A        validationResults1.add(ValidationResult.MISSING_EMAIL);%0A%0A        List%3CValidationResult%3E validationResults2 = new ArrayList%3C%3E();%0A        validationResults2.add(ValidationResult.NON_UNIQUE_MOBILE);%0A        validationResults2.add(ValidationResult.NON_UNIQUE_EMAIL);%0A        validationResults2.add(ValidationResult.NON_UNIQUE_PHONE);%0A%0A        when(completenessValidator.checkCompleteness(any())).thenReturn(validationResults1);%0A        when(uniquenessValidator.checkUniqueness(any())).thenReturn(validationResults2);%0A%0A        List%3CValidationResult%3E aggregatedResults = sut.validate(contactInformation);%0A        verify(completenessValidator).checkCompleteness(isA(ContactInformation.class));%0A        verify(uniquenessValidator).checkUniqueness(isA(ContactInformation.class));%0A%0A        Assert.assertEquals(%22wrong number of aggregated results%22, 5, aggregatedResults.size());%0A    %7D%0A%7D

add test for aggregating contactinfo validator