@@ -0,0 +1,1976 @@
+package com.mmnaseri.utils.samples.spring.data.jpa.service.impl;%0A%0Aimport com.mmnaseri.utils.samples.spring.data.jpa.model.Customer;%0Aimport com.mmnaseri.utils.samples.spring.data.jpa.repository.CustomerRepository;%0Aimport org.testng.annotations.BeforeMethod;%0Aimport org.testng.annotations.Test;%0A%0Aimport java.util.Calendar;%0Aimport java.util.Date;%0Aimport java.util.GregorianCalendar;%0A%0Aimport static com.mmnaseri.utils.spring.data.dsl.factory.RepositoryFactoryBuilder.builder;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.Matchers.*;%0A%0A/**%0A * @author Mohammad Milad Naseri (m.m.naseri@gmail.com)%0A * @since 1.0 (6/12/16, 2:03 PM)%0A */%0Apublic class DefaultCustomerServiceTest %7B%0A%0A    private DefaultCustomerService service;%0A    private CustomerRepository repository;%0A%0A    @BeforeMethod%0A    public void setUp() throws Exception %7B%0A        repository = builder().mock(CustomerRepository.class);%0A        service = new DefaultCustomerService(repository);%0A    %7D%0A%0A    @Test%0A    public void testCustomerRegistration() throws Exception %7B%0A        final Date date = getDate(1988, 0, 1);%0A        assertThat(repository.count(), is(0L));%0A        final String firstName = %22Milad%22;%0A        final String lastName = %22Naseri%22;%0A        final long id = service.register(firstName, lastName, date);%0A        assertThat(repository.count(), is(1L));%0A        final Customer customer = repository.findOne(id);%0A        assertThat(customer, is(notNullValue()));%0A        assertThat(customer.getId(), is(id));%0A        assertThat(customer.getFirstName(), is(firstName));%0A        assertThat(customer.getLastName(), is(lastName));%0A        assertThat(customer.getBirthday(), is(date));%0A    %7D%0A%0A    private Date getDate(int year, int month, int day) %7B%0A        final Calendar calendar = new GregorianCalendar();%0A        calendar.set(Calendar.YEAR, year);%0A        calendar.set(Calendar.MONTH, month + 1);%0A        calendar.set(Calendar.DATE, day);%0A        return calendar.getTime();%0A    %7D%0A%0A%7D

add tests for entity creation