1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-12-22 10:59:01 +00:00

chore: use Collections.emptyList() instead of new ArrayList()

This commit is contained in:
Arnaud Roques 2024-02-24 12:03:21 +01:00
parent 3cc68235dd
commit f385bc0dba
3 changed files with 6 additions and 4 deletions

View File

@ -2,8 +2,8 @@ package net.sourceforge.plantuml.tim.stdlib;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.List; import java.util.List;
import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores; import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores;
@ -25,7 +25,7 @@ class GetAllStdlibTest {
@Test @Test
void Test_without_Param() throws EaterException { void Test_without_Param() throws EaterException {
final List<TValue> empty = new ArrayList<>(); final List<TValue> empty = Collections.emptyList();
final TValue tValue = cut.executeReturnFunction(null, null, null, empty, null); final TValue tValue = cut.executeReturnFunction(null, null, null, empty, null);
assertThat(tValue.toString()).contains("archimate", "aws", "tupadr3"); assertThat(tValue.toString()).contains("archimate", "aws", "tupadr3");
} }

View File

@ -3,6 +3,7 @@ package net.sourceforge.plantuml.tim.stdlib;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores; import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores;
@ -24,7 +25,7 @@ class GetAllThemeTest {
@Test @Test
void Test_without_Param() throws EaterException { void Test_without_Param() throws EaterException {
final List<TValue> empty = new ArrayList<>(); final List<TValue> empty = Collections.emptyList();
final TValue tValue = cut.executeReturnFunction(null, null, null, empty, null); final TValue tValue = cut.executeReturnFunction(null, null, null, empty, null);
assertThat(tValue.toString()).contains("_none_", "amiga", "vibrant"); assertThat(tValue.toString()).contains("_none_", "amiga", "vibrant");
} }

View File

@ -4,6 +4,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.List; import java.util.List;
import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores; import org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores;
@ -26,7 +27,7 @@ class RandomFunctionTest {
@RepeatedTest(value = 10, name = repetitionLabel + cutName + "()") @RepeatedTest(value = 10, name = repetitionLabel + cutName + "()")
void test_with_no_argument() throws EaterException { void test_with_no_argument() throws EaterException {
final List<TValue> empty = new ArrayList<>(); final List<TValue> empty = Collections.emptyList();
final TValue tValue = cut.executeReturnFunction(null, null, null, empty, null); final TValue tValue = cut.executeReturnFunction(null, null, null, empty, null);
assertThat(tValue.toInt()).isIn(0, 1); assertThat(tValue.toInt()).isIn(0, 1);
} }