@@ -0,0 +1,1362 @@
+package ch.uzh.csg.reimbursement.service;%0A%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.Matchers.equalTo;%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.mockito.BDDMockito.given;%0Aimport static org.mockito.Mockito.mock;%0A%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.InjectMocks;%0Aimport org.mockito.Mock;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0A%0Aimport ch.uzh.csg.reimbursement.model.User;%0Aimport ch.uzh.csg.reimbursement.model.exception.UserNotFoundException;%0Aimport ch.uzh.csg.reimbursement.repository.UserRepositoryProvider;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class UserServiceTest %7B%0A%0A%09@InjectMocks%0A%09private UserService service;%0A%0A%09@Mock%0A%09private UserRepositoryProvider repository;%0A%0A%09@Test(expected = UserNotFoundException.class)%0A%09public void testFindByUidIfNoUserIsFound() %7B%0A%0A%09%09// given%0A%09%09String uid = %22fancy-user-id%22;%0A%09%09given(repository.findByUid(uid)).willReturn(null);%0A%0A%09%09// when%0A%09%09service.findByUid(uid);%0A%0A%09%09// then%0A%09%09// above mentioned exception is thrown%0A%09%7D%0A%0A%09@Test%0A%09public void testFindByUidIfAUserIsFound() %7B%0A%0A%09%09// given%0A%09%09String uid = %22fancy-user-id%22;%0A%09%09User user = mock(User.class);%0A%09%09given(repository.findByUid(uid)).willReturn(user);%0A%0A%09%09// when%0A%09%09User returningUser = service.findByUid(uid);%0A%0A%09%09// then%0A%09%09assertThat(returningUser, is(equalTo(user)));%0A%0A%09%7D%0A%0A%7D%0A

add UserServiceTest for findByUid method