/*
 * Copyright 2021 Red Hat, Inc. and/or its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.Paths

// Check the generated resources - all resources should be added in the basic-project
Path projectPath = basedir.toPath().resolve("project/basic-project")
assert Files.exists(projectPath.resolve("src/main/resources/test-process.bpmn2"))
assert Files.exists(projectPath.resolve("src/test/java/it/pkg/GreetingsTest.java"))
assert Files.exists(projectPath.resolve("src/main/resources/TrafficViolation.dmn"))
assert Files.exists(projectPath.resolve("src/test/java/it/pkg/TrafficViolationTest.java"))

// Check starters in pom.xml - no starters specified, so kogito-spring-boot-starter should be added in the basic-project
String pomContent = Files.readString(projectPath.resolve("pom.xml"))
assert pomContent.contains("kogito-spring-boot-starter")
// Check Maven plugin in pom.xml
assert pomContent.contains("kogito-processes-maven-plugin")

// Also no addons were specified
assert !pomContent.contains("addon")