Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. public class ParentalControlServiceImplTest {
  2. @Autowired
  3. ParentalControlService parentalControlService;
  4.  
  5. @Before
  6. public void setUp() throws Exception {
  7. ParentalControlServiceImpl parentalControlServiceImpl = new ParentalControlServiceImpl();
  8. parentalControlServiceImpl.setMovieService(new MovieServiceMock());
  9. parentalControlService = parentalControlServiceImpl;
  10. }
  11.  
  12. @Test
  13. public void testCanWatchMovie() throws Exception {
  14. Assert.assertTrue(parentalControlService.canWatchMovie("U", "movie1"));
  15. }
  16.  
  17. @Test(expected= TitleNotFoundException.class)
  18. public void testCanWatchMovieTwo() throws Exception {
  19. parentalControlService.canWatchMovie("U","movie756756");
  20. }
  21.  
  22. @Test(expected= TechnicalFailureException.class)
  23. public void testCanWatchMovieThree() throws Exception {
  24. parentalControlService.canWatchMovie("U","");
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement