@@ -0,0 +1,2528 @@
+package com.imrenagi.service_account.repositories;%0A%0Aimport com.imrenagi.service_account.AccountApplication;%0Aimport com.imrenagi.service_account.domains.Account;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.boot.test.SpringApplicationConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0A%0Aimport static org.junit.Assert.*;%0A%0A/**%0A * Created by imrenagi on 5/14/17.%0A */%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@SpringApplicationConfiguration(classes = AccountApplication.class)%0Apublic class AccountRepositoryTest %7B%0A%0A    @Autowired%0A    private AccountRepository repository;%0A%0A    @Test%0A    public void shouldFindAccountByUsername() %7B%0A%0A        Account stub = getStubAccount();%0A        repository.save(stub);%0A%0A        Account found = repository.findByUsername(stub.getUsername());%0A        assertNotNull(stub.getId());%0A        assertEquals(stub.getFirstName(), found.getFirstName());%0A        assertEquals(stub.getLastName(), found.getLastName());%0A        assertEquals(stub.getEmail(), found.getEmail());%0A        assertEquals(stub.getAddress(), found.getAddress());%0A        assertEquals(stub.getPhoneNumber(), found.getPhoneNumber());%0A        assertNotNull(found.getCreatedAt());%0A        assertNotNull(found.getUpdatedAt());%0A        assertNull(found.getDeletedAt());%0A%0A        repository.delete(found);%0A    %7D%0A%0A    @Test%0A    public void shouldFindAccountByEmail() %7B%0A%0A        Account stub = getStubAccount();%0A        repository.save(stub);%0A%0A        Account found = repository.findByEmail(stub.getEmail());%0A        assertNotNull(stub.getId());%0A        assertEquals(stub.getFirstName(), found.getFirstName());%0A        assertEquals(stub.getLastName(), found.getLastName());%0A        assertEquals(stub.getEmail(), found.getEmail());%0A        assertEquals(stub.getAddress(), found.getAddress());%0A        assertEquals(stub.getPhoneNumber(), found.getPhoneNumber());%0A        assertNotNull(found.getCreatedAt());%0A        assertNotNull(found.getUpdatedAt());%0A        assertNull(found.getDeletedAt());%0A%0A        repository.delete(found);%0A    %7D%0A%0A    private Account getStubAccount() %7B%0A%0A        Account account = new Account();%0A        account.setUsername(%22imrenagi%22);%0A        account.setFirstName(%22Imre%22);%0A        account.setLastName(%22Nagi%22);%0A        account.setEmail(%22imrenagi@gmail.com%22);%0A        account.setAddress(%221600 Villa Street%22);%0A        account.setPhoneNumber(%22+16504354123%22);%0A%0A        return account;%0A    %7D%0A%0A%7D

Test account repository