@Test void testDeleteAll() { User user = mock(User.class); RoleMembership roleMembership = mock(RoleMembership.class); when(roleMembership.getUser()).thenReturn(user); doAnswer( invocation -> { Consumer<List<Entity>> consumer = invocation.getArgument(1); consumer.accept(singletonList(roleMembership)); return null; }) .when(delegateRepository) .forEachBatched(eq(null), any(), eq(1000)); roleMembershipDecorator.deleteAll(); verify(sessionSecurityContextUpdater).resetAuthorities(user); }
@Override public void deleteAll() { forEachBatched(roleMemberships -> roleMemberships.forEach(this::preDelete), BATCH_SIZE); super.deleteAll(); }
RoleMembershipDecorator extends AbstractRepositoryDecorator<RoleMembership> { @Override public void deleteAll() { forEachBatched(roleMemberships -> roleMemberships.forEach(this::preDelete), BATCH_SIZE); super.deleteAll(); } }
RoleMembershipDecorator extends AbstractRepositoryDecorator<RoleMembership> { @Override public void deleteAll() { forEachBatched(roleMemberships -> roleMemberships.forEach(this::preDelete), BATCH_SIZE); super.deleteAll(); } RoleMembershipDecorator(
      Repository<RoleMembership> delegateRepository,
      RoleMembershipValidator roleMembershipValidator,
      SessionSecurityContextUpdater securityContextUpdater); }
RoleMembershipDecorator extends AbstractRepositoryDecorator<RoleMembership> { @Override public void deleteAll() { forEachBatched(roleMemberships -> roleMemberships.forEach(this::preDelete), BATCH_SIZE); super.deleteAll(); } RoleMembershipDecorator(
      Repository<RoleMembership> delegateRepository,
      RoleMembershipValidator roleMembershipValidator,
      SessionSecurityContextUpdater securityContextUpdater); @Override void add(RoleMembership roleMembership); @Override Integer add(Stream<RoleMembership> roleMembershipStream); @Override void update(RoleMembership roleMembership); @Override void update(Stream<RoleMembership> roleMembershipStream); @Override void delete(RoleMembership roleMembership); @Override void deleteById(Object id); @Override void deleteAll(); @Override void delete(Stream<RoleMembership> roleMembershipStream); @Override void deleteAll(Stream<Object> ids); }
RoleMembershipDecorator extends AbstractRepositoryDecorator<RoleMembership> { @Override public void deleteAll() { forEachBatched(roleMemberships -> roleMemberships.forEach(this::preDelete), BATCH_SIZE); super.deleteAll(); } RoleMembershipDecorator(
      Repository<RoleMembership> delegateRepository,
      RoleMembershipValidator roleMembershipValidator,
      SessionSecurityContextUpdater securityContextUpdater); @Override void add(RoleMembership roleMembership); @Override Integer add(Stream<RoleMembership> roleMembershipStream); @Override void update(RoleMembership roleMembership); @Override void update(Stream<RoleMembership> roleMembershipStream); @Override void delete(RoleMembership roleMembership); @Override void deleteById(Object id); @Override void deleteAll(); @Override void delete(Stream<RoleMembership> roleMembershipStream); @Override void deleteAll(Stream<Object> ids);  }