use of com.nexblocks.authguard.service.model.PermissionBO in project AuthGuard by AuthGuard.
the class PermissionsServiceImplTest method getById.
@Test
void getById() {
final PermissionDO permission = PermissionDO.builder().id("permission").group("test").name("read").build();
final PermissionBO expected = PermissionBO.builder().id("permission").group("test").name("read").build();
Mockito.when(permissionsRepository.getById(permission.getId())).thenReturn(CompletableFuture.completedFuture(Optional.of(permission)));
final Optional<PermissionBO> actual = permissionsService.getById(permission.getId());
assertThat(actual).contains(expected);
}
use of com.nexblocks.authguard.service.model.PermissionBO in project AuthGuard by AuthGuard.
the class PermissionsServiceImplTest method delete.
@Test
void delete() {
final PermissionDO permission = PermissionDO.builder().id("permission").group("test").name("read").build();
final PermissionBO expected = PermissionBO.builder().id("permission").group("test").name("read").build();
Mockito.when(permissionsRepository.delete(permission.getId())).thenReturn(CompletableFuture.completedFuture(Optional.of(permission)));
final Optional<PermissionBO> actual = permissionsService.delete(permission.getId());
assertThat(actual).contains(expected);
}
Aggregations