Guest User

Untitled

a guest
Oct 16th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. public class CategoriesServiceImplTest {
  2.  
  3.  
  4. @Mock
  5. CategoriesDao categoriesDao;
  6.  
  7. @Before
  8. public void setup(){
  9. MockitoAnnotations.initMocks(this);
  10. }
  11.  
  12. @Test
  13. public void testGetCategories() throws Exception {
  14. CategoriesService categoriesService = new CategoriesServiceImpl();
  15. when(categoriesDao.getCategories()).thenReturn(null);
  16. Assert.assertNull(categoriesService.getCategories());
  17.  
  18. }
  19. }
Add Comment
Please, Sign In to add comment