Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CategoriesServiceImplTest {
- @Mock
- CategoriesDao categoriesDao;
- @Before
- public void setup(){
- MockitoAnnotations.initMocks(this);
- }
- @Test
- public void testGetCategories() throws Exception {
- CategoriesService categoriesService = new CategoriesServiceImpl();
- when(categoriesDao.getCategories()).thenReturn(null);
- Assert.assertNull(categoriesService.getCategories());
- }
- }
Add Comment
Please, Sign In to add comment