I've done it with two annotations for test class: @RunWith(SpringRunner.class)
and @SpringBootTest
.
Example:
@RunWith(SpringRunner.class )
@SpringBootTest
public class ProtocolTransactionServiceTest {
@Autowired
private ProtocolTransactionService protocolTransactionService;
}
@SpringBootTest
loads the whole context, which was OK in my case.