|
| 1 | +/* |
| 2 | + * To change this license header, choose License Headers in Project Properties. |
| 3 | + * To change this template file, choose Tools | Templates |
| 4 | + * and open the template in the editor. |
| 5 | + */ |
| 6 | +package com.mvpjava.it; |
| 7 | + |
| 8 | +import com.mvpjava.Company; |
| 9 | +import com.mvpjava.Employee; |
| 10 | +import com.mvpjava.extensions.MockitoExtension; |
| 11 | +import org.junit.jupiter.api.DisplayName; |
| 12 | +import org.junit.jupiter.api.*; |
| 13 | +import org.junit.jupiter.api.extension.ExtendWith; |
| 14 | +import org.springframework.test.context.junit.jupiter.SpringExtension; |
| 15 | +import static org.junit.jupiter.api.Assertions.*; |
| 16 | +import org.junit.platform.runner.JUnitPlatform; |
| 17 | +import org.junit.runner.RunWith; |
| 18 | +import org.mockito.Mock; |
| 19 | +import org.springframework.beans.factory.annotation.Autowired; |
| 20 | +import org.springframework.boot.test.context.SpringBootTest; |
| 21 | + |
| 22 | +@RunWith(JUnitPlatform.class) |
| 23 | +@SpringBootTest |
| 24 | +@ExtendWith(SpringExtension.class) |
| 25 | +@ExtendWith(MockitoExtension.class) |
| 26 | + |
| 27 | +public class SpringWithJUnit5MultipleExtensionsIT { |
| 28 | + |
| 29 | + @Test |
| 30 | + @DisplayName("Checking if ParameterResolver works for @Autowired and @Mock") |
| 31 | + void checkMultipleParameterResolvers( |
| 32 | + @Autowired Company company, |
| 33 | + @Mock Employee newHire) { |
| 34 | + assertTrue(company.addEmployee(newHire)); |
| 35 | + } |
| 36 | +} |
0 commit comments