@SuppressWarnings("unchecked") @Test void testDeleteStream() { User user = mock(User.class); RoleMembership roleMembership = mock(RoleMembership.class); when(roleMembership.getUser()).thenReturn(user); doAnswer(invocation -> ((Stream<?>) invocation.getArguments()[0]).count()) .when(delegateRepository) .delete(any(Stream.class)); roleMembershipDecorator.delete(Stream.of(roleMembership)); verify(sessionSecurityContextUpdater).resetAuthorities(user); }
@Override public void delete(RoleMembership roleMembership) { preDelete(roleMembership); super.delete(roleMembership); }
RoleMembershipDecorator extends AbstractRepositoryDecorator<RoleMembership> { @Override public void delete(RoleMembership roleMembership) { preDelete(roleMembership); super.delete(roleMembership); } }
RoleMembershipDecorator extends AbstractRepositoryDecorator<RoleMembership> { @Override public void delete(RoleMembership roleMembership) { preDelete(roleMembership); super.delete(roleMembership); } RoleMembershipDecorator(
      Repository<RoleMembership> delegateRepository,
      RoleMembershipValidator roleMembershipValidator,
      SessionSecurityContextUpdater securityContextUpdater); }
RoleMembershipDecorator extends AbstractRepositoryDecorator<RoleMembership> { @Override public void delete(RoleMembership roleMembership) { preDelete(roleMembership); super.delete(roleMembership); } 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 delete(RoleMembership roleMembership) { preDelete(roleMembership); super.delete(roleMembership); } 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);  }