diff --git a/src/main/java/com/faforever/client/map/generator/GeneratorCommand.java b/src/main/java/com/faforever/client/map/generator/GeneratorCommand.java index 27f273fce7..e2ba8432ff 100644 --- a/src/main/java/com/faforever/client/map/generator/GeneratorCommand.java +++ b/src/main/java/com/faforever/client/map/generator/GeneratorCommand.java @@ -95,7 +95,7 @@ public List getCommand() { command.addAll(Arrays.asList("--reclaim-density", reclaimDensity.toString())); } - if (biome != null) { + if (biome != null && !biome.equals(MapGeneratorService.GENERATOR_RANDOM_BIOME)) { command.addAll(Arrays.asList("--biome", biome)); } diff --git a/src/test/java/com/faforever/client/map/generator/GeneratorCommandTest.java b/src/test/java/com/faforever/client/map/generator/GeneratorCommandTest.java index 4cf2dda4d3..44d5ad2134 100644 --- a/src/test/java/com/faforever/client/map/generator/GeneratorCommandTest.java +++ b/src/test/java/com/faforever/client/map/generator/GeneratorCommandTest.java @@ -8,6 +8,9 @@ import java.nio.file.Path; import java.util.List; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.not; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -146,6 +149,18 @@ public void testBiomeSet() { assertTrue(command.containsAll(List.of("--biome", "TEST"))); } + @Test + public void testRandomStyleSet() { + List command = defaultBuilder().style("RANDOM").build().getCommand(); + assertThat(command, not(contains("--style"))); + } + + @Test + public void testRandomBiomeSet() { + List command = defaultBuilder().biome("RANDOM").build().getCommand(); + assertThat(command, not(contains("--biome"))); + } + @Test public void testCommandArgsSet() { List command = defaultBuilder().commandLineArgs("--help").build().getCommand();