@VisibleForTesting
  Path getWarArtifact() {
    Build build = project.getBuild();
    String warName = build.getFinalName();

    Plugin warPlugin = project.getPlugin("org.apache.maven.plugins:maven-war-plugin");
    if (warPlugin != null) {
      for (PluginExecution execution : warPlugin.getExecutions()) {
        if ("default-war".equals(execution.getId())) {
          Xpp3Dom configuration = (Xpp3Dom) execution.getConfiguration();
          warName = getChildValue(configuration, "warName").orElse(warName);
        }
      }
    }

    return Paths.get(build.getDirectory(), warName + ".war");
  }
@Test
  public void testGetWarArtifact_noWarNameProperty() {
    when(mockBuild.getDirectory()).thenReturn(Paths.get("/foo/bar").toString());
    when(mockBuild.getFinalName()).thenReturn("helloworld-1");

    when(mockMavenProject.getPlugin("org.apache.maven.plugins:maven-war-plugin"))
        .thenReturn(mockPlugin);
    when(mockPlugin.getExecutions()).thenReturn(Arrays.asList(mockPluginExecution));
    when(mockPluginExecution.getId()).thenReturn("default-war");
    Mockito.lenient().when(mockPluginExecution.getConfiguration()).thenReturn(pluginConfiguration);

    assertThat(mavenProjectProperties.getWarArtifact())
        .isEqualTo(Paths.get("/foo/bar/helloworld-1.war"));
  }