@Test
public void saveOperation() {

     Mockito.when(operationRepository.save(Mockito.any(Operation.class))).thenReturn(operation);
     Mockito.when(resourceRepository.findByApiIdAndId(Mockito.anyLong(), Mockito.anyLong()))
            .thenReturn(res);
     Mockito.when(operationRepository.findByResourceApiIdAndMethodAndPath(Mockito.anyLong(),
                                                                          Mockito.any(HttpMethod.class),
                                                                          Mockito.anyString()
     )).thenReturn(null);
     Mockito.when(operationJDBCRepository.patternExists(Mockito.anyString(), Mockito.anyLong())).thenReturn(false);
     Operation saved = operationService.save(api.getId(), res.getId(), operation);
     assertEquals(saved.getId(), operation.getId());
}