This commit is contained in:
1 parent
4d7ce211f5
commit
720fdc1687
4 files changed
+17
-11
No files matched your search
@@ -55,14 +55,14 @@ final class ChampionTrophyDirectoryTest {
|
||||
try(var restarted=new FishingDirectory(new YamlFishingRepository(data))){assertEquals(FishingState.TrophyPhase.PREPARED,restarted.snapshot().trophies().getFirst().phase());assertTrue(restarted.trophies(carrier).isEmpty());assertEquals(FishingDirectory.TrophyRedeemStatus.NOT_FOUND,restarted.redeemTrophy(trophy.id(),carrier).get(5,TimeUnit.SECONDS));assertEquals(FishingDirectory.TrophyCommitStatus.APPLIED,restarted.commitTrophy(trophy.id()).get(5,TimeUnit.SECONDS));assertEquals(trophy.earned(),restarted.trophies(carrier).getFirst());}
|
||||
}
|
||||
|
||||
@Test void sameNameHeadsRemainDistinctAndFailedRedemptionRetainsBoth() throws Exception {
|
||||
UUID carrier=UUID.randomUUID(),beneficiary=UUID.randomUUID(),site=UUID.randomUUID();
|
||||
@Test void sameNameCampSpoilsRemainDistinctAndFailedRedemptionRetainsBoth() throws Exception {
|
||||
UUID carrier=UUID.randomUUID(),beneficiary=UUID.randomUUID();
|
||||
try(var directory=new FishingDirectory(new YamlFishingRepository(data))){
|
||||
for(int index=0;index<2;index++){
|
||||
var rewards=new LinkedHashMap<UUID,FishingState.Reward>();
|
||||
rewards.put(beneficiary,new FishingState.Reward(BigInteger.valueOf(10+index),BigInteger.ONE));
|
||||
var trophy=new FishingState.Trophy(UUID.randomUUID(),FishingState.TrophyType.CHAMPION,carrier,UUID.randomUUID(),
|
||||
site,UUID.randomUUID(),UUID.randomUUID(),"Daybreak Champion Head","Summit",rewards);
|
||||
var trophy=new FishingState.Trophy(UUID.randomUUID(),FishingState.TrophyType.CAMP,carrier,UUID.randomUUID(),
|
||||
UUID.randomUUID(),UUID.randomUUID(),UUID.randomUUID(),"Spoils of Twin Camp","Twin Camp",rewards);
|
||||
assertEquals(FishingDirectory.TrophyPrepareStatus.APPLIED,directory.prepareTrophy(trophy).get(5,TimeUnit.SECONDS));
|
||||
assertEquals(FishingDirectory.TrophyCommitStatus.APPLIED,directory.commitTrophy(trophy.id()).get(5,TimeUnit.SECONDS));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user