File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
main/java/com/faforever/api/clan
test/java/com/faforever/api/clan Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 2222
2323import java .time .Instant ;
2424import java .time .temporal .ChronoUnit ;
25- import java .util .List ;
25+ import java .util .Set ;
2626
2727@ Service
2828@ RequiredArgsConstructor
@@ -58,9 +58,10 @@ public void preCreate(Clan clan) {
5858 });
5959
6060 clan .setLeader (player );
61- clan .setMemberships (List .of (new ClanMembership ()
62- .setClan (clan )
63- .setPlayer (player )));
61+ final ClanMembership clanMembership = new ClanMembership ();
62+ clanMembership .setClan (clan );
63+ clanMembership .setPlayer (player );
64+ clan .setMemberships (Set .of (clanMembership ));
6465 }
6566
6667 @ SneakyThrows
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ void success() {
143143 assertThat (clan .getFounder (), is (player ));
144144 assertThat (clan .getLeader (), is (player ));
145145 assertThat (clan .getMemberships ().size (), is (1 ));
146- assertThat (clan .getMemberships ().get ( 0 ).getPlayer (), is (player ));
146+ assertThat (clan .getMemberships ().iterator (). next ( ).getPlayer (), is (player ));
147147
148148 verify (playerService ).getCurrentPlayer ();
149149 verify (clanRepository ).findOneByName (any ());
You can’t perform that action at this time.
0 commit comments