@@ -0,0 +1,2600 @@
+package garbagetown.domain.service.customer;%0A%0Aimport garbagetown.domain.model.Customer;%0Aimport garbagetown.domain.repository.CustomerRepository;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;%0Aimport org.terasoluna.gfw.common.sequencer.Sequencer;%0A%0Aimport static org.hamcrest.CoreMatchers.is;%0Aimport static org.hamcrest.CoreMatchers.nullValue;%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0A%0A/**%0A * Created by garbagetown on 11/19/15.%0A */%0Apublic class CustomerServiceImplTest %7B%0A%0A    CustomerServiceImpl customerService;%0A    CustomerRepository customerRepository;%0A    Sequencer%3CString%3E customerCodeSeq;%0A    BCryptPasswordEncoder passwordEncoder;%0A%0A    @Before%0A    public void setUp() %7B%0A        customerService = new CustomerServiceImpl();%0A%0A        customerRepository = mock(CustomerRepository.class);%0A        customerService.customerRepository = customerRepository;%0A%0A        customerCodeSeq = mock(Sequencer.class);%0A        customerService.customerCodeSeq = customerCodeSeq;%0A%0A        passwordEncoder = new BCryptPasswordEncoder();%0A        customerService.passwordEncoder = passwordEncoder;%0A    %7D%0A%0A    @Test%0A    public void testFindOne() %7B%0A        String customerCode = %2200000001%22;%0A%0A        Customer customer = new Customer();%0A        when(customerRepository.findOne(customerCode)).thenReturn(customer);%0A%0A        Customer result = customerService.findOne(customerCode);%0A%0A        assertThat(result, is(customer));%0A    %7D%0A%0A    @Test%0A    public void testFindOne_notFound() %7B%0A        String customerCode = %2299999999%22;%0A%0A        when(customerRepository.findOne(customerCode)).thenReturn(null);%0A%0A        Customer result = customerService.findOne(customerCode);%0A%0A        assertThat(result, is(nullValue()));%0A    %7D%0A%0A    @Test%0A    public void testRegister() %7B%0A%0A        String customerCode = %2200000002%22;%0A        when(customerCodeSeq.getNext()).thenReturn(customerCode);%0A%0A        String rawPassword = %22password%22;%0A        String customerPass = passwordEncoder.encode(rawPassword);%0A%0A        Customer customer = new Customer();%0A        customer.setCustomerCode(customerCode);%0A        customer.setCustomerPass(customerPass);%0A%0A        when(customerRepository.save(customer)).thenReturn(customer);%0A%0A        Customer result = customerService.register(customer, rawPassword);%0A%0A        assertThat(result.getCustomerCode(), is(customerCode));%0A        assertTrue(passwordEncoder.matches(rawPassword, result.getCustomerPass()));%0A    %7D%0A%7D%0A

add a test for customer service