@@ -0,0 +1,1647 @@
+package org.opensingular.server.commons.persistence.dao;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0Aimport org.opensingular.server.commons.persistence.dao.form.PetitionerDAO;%0Aimport org.opensingular.server.commons.persistence.entity.enums.PersonType;%0Aimport org.opensingular.server.commons.persistence.entity.form.PetitionerEntity;%0Aimport org.opensingular.server.commons.test.SingularCommonsBaseTest;%0A%0Aimport javax.inject.Inject;%0Aimport javax.transaction.Transactional;%0A%0Apublic class PetitionerDAOTest extends SingularCommonsBaseTest %7B%0A%0A    @Inject%0A    private PetitionerDAO petitionerDAO;%0A%0A    @Test%0A    @Transactional%0A    public void testFindByExternalId()%7B%0A        final String externa = %22pessoaExterna%22;%0A%0A        PetitionerEntity entity = new PetitionerEntity();%0A        entity.setPersonType(PersonType.FISICA);%0A        entity.setIdPessoa(externa);%0A        entity.setCpfCNPJ(%2212345678900%22);%0A        entity.setName(%22pessoa%22);%0A%0A        petitionerDAO.save(entity);%0A%0A        PetitionerEntity petitionerByExternalId = petitionerDAO.findPetitionerByExternalId(externa);%0A%0A        Assert.assertEquals(entity, petitionerByExternalId);%0A        Assert.assertEquals(entity.getCod(), petitionerByExternalId.getCod());%0A        Assert.assertEquals(entity.getName(), petitionerByExternalId.getName());%0A        Assert.assertEquals(entity.getCpfCNPJ(), petitionerByExternalId.getCpfCNPJ());%0A        Assert.assertEquals(entity.getIdPessoa(), petitionerByExternalId.getIdPessoa());%0A        Assert.assertEquals(entity.getPersonType(), petitionerByExternalId.getPersonType());%0A%0A        Assert.assertNull(petitionerDAO.findPetitionerByExternalId(%22%22));%0A    %7D%0A%7D%0A

teste findByExternalId PetitionerDAO