@Test public void shouldChangeStatusIfDetached() { MemberEntryEntity member = memberRepository.save(MemberEntryEntity.builder().id("member1").build()); membershipRepository.save(MembershipEntryEntity.builder() .membershipId(1L) .groupId("group1") .event(MembershipEntryEntity.Event.DETACHED) .date(LocalDate.now().minusDays(3)) .member(member) .build()); memberService.syncMembers(); Optional<MembershipEntryEntity> entry = membershipRepository.findFirstByMemberIdAndGroupIdOrderByDateDesc("member1", "group1"); assertThat(entry).isPresent(); assertThat(entry.get().getEvent()).isEqualTo(MembershipEntryEntity.Event.ATTACHED); assertThat(entry.get().getDate()).isEqualTo(LocalDate.now()); assertThat(entry.get().getGroupId()).isEqualTo("group1"); assertThat(entry.get().getMember().getId()).isEqualTo("member1"); }
public void syncMembers() { log.info("> Sync members"); syncLocalMembers(); syncRemoteMembers(); log.info("< Synced members"); }
MemberService { public void syncMembers() { log.info("> Sync members"); syncLocalMembers(); syncRemoteMembers(); log.info("< Synced members"); } }
MemberService { public void syncMembers() { log.info("> Sync members"); syncLocalMembers(); syncRemoteMembers(); log.info("< Synced members"); }  }
MemberService { public void syncMembers() { log.info("> Sync members"); syncLocalMembers(); syncRemoteMembers(); log.info("< Synced members"); }  void syncMembers(); List<Member> groupMembers(String groupId); List<Member> groupMembers(String groupId, LocalDate form, LocalDate to); List<GroupLightModel> memberGroups(String memberId); List<GroupLightModel> memberGroups(String memberId, LocalDate form, LocalDate to); Map<String, Long> getIntegrationsSummary(); }
MemberService { public void syncMembers() { log.info("> Sync members"); syncLocalMembers(); syncRemoteMembers(); log.info("< Synced members"); }  void syncMembers(); List<Member> groupMembers(String groupId); List<Member> groupMembers(String groupId, LocalDate form, LocalDate to); List<GroupLightModel> memberGroups(String memberId); List<GroupLightModel> memberGroups(String memberId, LocalDate form, LocalDate to); Map<String, Long> getIntegrationsSummary();  }