@Test public void shouldNotCreateNewEntryIfAlreadyDetached() { MemberEntryEntity member = memberRepository.save(MemberEntryEntity.builder().id("member1").build()); membershipRepository.save(MembershipEntryEntity.builder() .groupId("group2") .event(MembershipEntryEntity.Event.DETACHED) .date(LocalDate.now().minusDays(3)) .member(member) .build()); memberService.syncMembers(); List<MembershipEntryEntity> entries = membershipRepository.findAll().stream().filter(e -> "group2".equals(e.getGroupId())).collect(Collectors.toList()); assertThat(entries).hasSize(1); assertThat(entries.get(0).getEvent()).isEqualTo(MembershipEntryEntity.Event.DETACHED); assertThat(entries.get(0).getDate()).isEqualTo(LocalDate.now().minusDays(3)); assertThat(entries.get(0).getGroupId()).isEqualTo("group2"); assertThat(entries.get(0).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();  }