### Question:
ExecuteGoalsCommand extends AbstractMavenCommand { @Override public MavenRequest buildMavenRequest() { final String pomPath = baseDirectory + FileSystems.getDefault().getSeparator() + POM_XML; final MavenRequest mavenRequest = MavenProjectLoader.createMavenRequest(false); mavenRequest.setGoals(goals); mavenRequest.setPom(pomPath); return mavenRequest; } ExecuteGoalsCommand(final String baseDirectory);  ExecuteGoalsCommand(final String baseDirectory,
                               final List<String> goals); @Override MavenRequest buildMavenRequest(); @Override Properties buildUserProperties(); static final String POM_XML; }### Answer:
@Test public void useDefaultGoalsTest() { final ExecuteGoalsCommand command = new ExecuteGoalsCommand(BASE_DIRECTORY); final MavenRequest request = command.buildMavenRequest(); assertThat(request.getGoals()).isEqualTo(ExecuteGoalsCommand.DEFAULT_GOALS); }
@Test public void useCustomGoalsTest() { final List<String> customGoals = Collections.singletonList("compile"); final ExecuteGoalsCommand command = new ExecuteGoalsCommand(BASE_DIRECTORY, customGoals); final MavenRequest request = command.buildMavenRequest(); assertThat(request.getGoals()).isEqualTo(customGoals); }
@Test public void buildMavenRequestTest() { final String pomPath = BASE_DIRECTORY + FileSystems.getDefault().getSeparator() + ExecuteGoalsCommand.POM_XML; final ExecuteGoalsCommand command = new ExecuteGoalsCommand(BASE_DIRECTORY); final MavenRequest request = command.buildMavenRequest(); assertThat(request.getPom()).isEqualTo(pomPath); assertThat(request.getGoals()).isEqualTo(ExecuteGoalsCommand.DEFAULT_GOALS); }