@Test void testUpdate() { User currentUser = mock(User.class); RoleMembership currentRoleMembership = mock(RoleMembership.class); when(currentRoleMembership.getUser()).thenReturn(currentUser); User updatedUser = mock(User.class); String roleMembershipId = "MyRoleMemberShipId"; RoleMembership updatedRoleMembership = mock(RoleMembership.class); when(updatedRoleMembership.getId()).thenReturn(roleMembershipId); when(updatedRoleMembership.getUser()).thenReturn(updatedUser); when(delegateRepository.findOneById(roleMembershipId)).thenReturn(currentRoleMembership); roleMembershipDecorator.update(updatedRoleMembership); verify(roleMembershipValidator).validate(updatedRoleMembership); verify(sessionSecurityContextUpdater).resetAuthorities(currentUser); verify(sessionSecurityContextUpdater).resetAuthorities(updatedUser); }
@Override public void update(RoleMembership roleMembership) { preUpdate(roleMembership); super.update(roleMembership); }
RoleMembershipDecorator extends AbstractRepositoryDecorator<RoleMembership> { @Override public void update(RoleMembership roleMembership) { preUpdate(roleMembership); super.update(roleMembership); } }
RoleMembershipDecorator extends AbstractRepositoryDecorator<RoleMembership> { @Override public void update(RoleMembership roleMembership) { preUpdate(roleMembership); super.update(roleMembership); } RoleMembershipDecorator(
      Repository<RoleMembership> delegateRepository,
      RoleMembershipValidator roleMembershipValidator,
      SessionSecurityContextUpdater securityContextUpdater); }
RoleMembershipDecorator extends AbstractRepositoryDecorator<RoleMembership> { @Override public void update(RoleMembership roleMembership) { preUpdate(roleMembership); super.update(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 update(RoleMembership roleMembership) { preUpdate(roleMembership); super.update(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);  }