Advertisement
marcelopaixaoresende

Untitled

Jun 12th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. public class MyServiceImplTest {
  2.     @Mock
  3.     private MyRepository myRepository;
  4.  
  5.     @Autowired
  6.     @InjectMocks
  7.     private MyServiceImpl myService;
  8.  
  9.     @Before
  10.     public void initMocks() {
  11.         MockitoAnnotations.initMocks(this);
  12.     }
  13.  
  14.     @Test(expected = ServiceException.class)
  15.     public void testSomething() throws ServiceException {
  16.         // My Test Code
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement