@Test public void findTest() { Mockito.when(scopeRepository.findByApiIdAndId(Mockito.anyLong(), Mockito.anyLong())).thenReturn(scope); Scope scopeActual = scopeService.find(this.scope.getApi().getId(), this.scope.getId()); assertEquals(scope, scopeActual); }
@Transactional(readOnly = true) public Scope find(final Long apiId, final Long scopeId) { final Scope scope = scopeRepository.findByApiIdAndId(apiId, scopeId); HeimdallException.checkThrow(scope == null, GLOBAL_RESOURCE_NOT_FOUND); return scope; }
ScopeService { @Transactional(readOnly = true) public Scope find(final Long apiId, final Long scopeId) { final Scope scope = scopeRepository.findByApiIdAndId(apiId, scopeId); HeimdallException.checkThrow(scope == null, GLOBAL_RESOURCE_NOT_FOUND); return scope; } }
ScopeService { @Transactional(readOnly = true) public Scope find(final Long apiId, final Long scopeId) { final Scope scope = scopeRepository.findByApiIdAndId(apiId, scopeId); HeimdallException.checkThrow(scope == null, GLOBAL_RESOURCE_NOT_FOUND); return scope; }  }
ScopeService { @Transactional(readOnly = true) public Scope find(final Long apiId, final Long scopeId) { final Scope scope = scopeRepository.findByApiIdAndId(apiId, scopeId); HeimdallException.checkThrow(scope == null, GLOBAL_RESOURCE_NOT_FOUND); return scope; }  @Transactional(readOnly = true) Scope find(final Long apiId, final Long scopeId); @Transactional(readOnly = true) ScopePage list(final Long apiId, final ScopeDTO scopeDTO, final PageableDTO pageableDTO); @Transactional(readOnly = true) List<Scope> list(final Long apiId, final ScopeDTO scopeDTO); @Transactional Scope save(final Long apiId, Scope scope); @Transactional void delete(final Long apiId, final Long scopeId); @Transactional Scope update(final Long apiId, final Long scopeId, Scope scope); }
ScopeService { @Transactional(readOnly = true) public Scope find(final Long apiId, final Long scopeId) { final Scope scope = scopeRepository.findByApiIdAndId(apiId, scopeId); HeimdallException.checkThrow(scope == null, GLOBAL_RESOURCE_NOT_FOUND); return scope; }  @Transactional(readOnly = true) Scope find(final Long apiId, final Long scopeId); @Transactional(readOnly = true) ScopePage list(final Long apiId, final ScopeDTO scopeDTO, final PageableDTO pageableDTO); @Transactional(readOnly = true) List<Scope> list(final Long apiId, final ScopeDTO scopeDTO); @Transactional Scope save(final Long apiId, Scope scope); @Transactional void delete(final Long apiId, final Long scopeId); @Transactional Scope update(final Long apiId, final Long scopeId, Scope scope);  }