Commit 5b8d0176 authored by Mathieu Féry (Mathius)'s avatar Mathieu Féry (Mathius)
Browse files

Merge branch 'api' into jonctApiFront

parents 09ba9189 98097435
Pipeline #28816 failed with stages
in 2 minutes and 59 seconds
...@@ -5,6 +5,7 @@ import androidx.annotation.Nullable; ...@@ -5,6 +5,7 @@ import androidx.annotation.Nullable;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
...@@ -85,6 +86,7 @@ public class DnDClass implements Serializable, Comparable<DnDClass> { ...@@ -85,6 +86,7 @@ public class DnDClass implements Serializable, Comparable<DnDClass> {
clas.add(ELF); clas.add(ELF);
clas.add(DWARF); clas.add(DWARF);
clas.add(HALFLING); clas.add(HALFLING);
Collections.sort(clas, DnDClass::compareTo);
classes = clas; classes = clas;
} }
......
...@@ -5,6 +5,7 @@ import androidx.annotation.Nullable; ...@@ -5,6 +5,7 @@ import androidx.annotation.Nullable;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
...@@ -70,6 +71,7 @@ public class DnDSystem implements Serializable, Comparable<DnDSystem> { ...@@ -70,6 +71,7 @@ public class DnDSystem implements Serializable, Comparable<DnDSystem> {
sys.add(moc); sys.add(moc);
sys.add(dd); sys.add(dd);
sys.add(lotfp); sys.add(lotfp);
Collections.sort(sys, DnDSystem::compareTo);
systems = sys; systems = sys;
} }
......
...@@ -3,6 +3,7 @@ package fr.iutnantes.miar.dndgenerator.api.dnd; ...@@ -3,6 +3,7 @@ package fr.iutnantes.miar.dndgenerator.api.dnd;
import org.junit.Test; import org.junit.Test;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
...@@ -19,7 +20,7 @@ public class DnDClassTest { ...@@ -19,7 +20,7 @@ public class DnDClassTest {
classSorted.add(DnDClass.DWARF); classSorted.add(DnDClass.DWARF);
classSorted.add(DnDClass.FIGHTER); classSorted.add(DnDClass.FIGHTER);
assertNotEquals(classSorted, classUnSorted); assertNotEquals(classSorted, classUnSorted);
classUnSorted.sort(DnDClass::compareTo); Collections.sort(classUnSorted, DnDClass::compareTo);
assertEquals(classSorted, classUnSorted); assertEquals(classSorted, classUnSorted);
} }
} }
...@@ -3,6 +3,7 @@ package fr.iutnantes.miar.dndgenerator.api.dnd; ...@@ -3,6 +3,7 @@ package fr.iutnantes.miar.dndgenerator.api.dnd;
import org.junit.Test; import org.junit.Test;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import static org.junit.Assert.*; import static org.junit.Assert.*;
...@@ -23,7 +24,7 @@ public class DnDSystemTest { ...@@ -23,7 +24,7 @@ public class DnDSystemTest {
systemsSorted.add(DnDSystem.lotfp); systemsSorted.add(DnDSystem.lotfp);
systemsSorted.add(DnDSystem.lbb); systemsSorted.add(DnDSystem.lbb);
assertNotEquals(systemsSorted, systemsUnSorted); assertNotEquals(systemsSorted, systemsUnSorted);
systemsUnSorted.sort(DnDSystem::compareTo); Collections.sort(systemsUnSorted, DnDSystem::compareTo);
assertEquals(systemsSorted, systemsUnSorted); assertEquals(systemsSorted, systemsUnSorted);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment