Search in sources :

Example 11 with PipelineConfigurationModel

use of com.redhat.devtools.intellij.tektoncd.utils.model.resources.PipelineConfigurationModel in project intellij-tekton by redhat-developer.

the class PipelineConfigurationModelTest method checkPipelineModelWithMultipleInputs.

@Test
public void checkPipelineModelWithMultipleInputs() throws IOException {
    String configuration = load("pipeline6.yaml");
    PipelineConfigurationModel model = (PipelineConfigurationModel) ConfigurationModelFactory.getModel(configuration);
    assertEquals(model.getName(), "foo");
    assertEquals(model.getNamespace(), "tekton");
    assertEquals(model.getKind(), "Pipeline");
    assertTrue(model.getParams().size() == 1);
    assertEquals(model.getParams().get(0).name(), "path");
    assertTrue(model.getInputResources().size() == 1);
    assertEquals(model.getInputResources().get(0).name(), "source-repo");
    assertEquals(model.getInputResources().get(0).type(), "git");
    assertTrue(model.getOutputResources().isEmpty());
    assertTrue(model.getWorkspaces().size() == 2);
    assertEquals(model.getWorkspaces().get(0).getName(), "password-vault");
    assertEquals(model.getWorkspaces().get(1).getName(), "recipe-store");
}
Also used : PipelineConfigurationModel(com.redhat.devtools.intellij.tektoncd.utils.model.resources.PipelineConfigurationModel) Test(org.junit.Test) BaseTest(com.redhat.devtools.intellij.tektoncd.BaseTest)

Aggregations

PipelineConfigurationModel (com.redhat.devtools.intellij.tektoncd.utils.model.resources.PipelineConfigurationModel)11 BaseTest (com.redhat.devtools.intellij.tektoncd.BaseTest)6 Test (org.junit.Test)6 ArrayList (java.util.ArrayList)5 ConfigurationModel (com.redhat.devtools.intellij.tektoncd.utils.model.ConfigurationModel)4 InspectionManager (com.intellij.codeInspection.InspectionManager)3 ProblemDescriptor (com.intellij.codeInspection.ProblemDescriptor)3 ProblemHighlightType (com.intellij.codeInspection.ProblemHighlightType)3 PsiElement (com.intellij.psi.PsiElement)3 PsiFile (com.intellij.psi.PsiFile)3 Collections (java.util.Collections)3 List (java.util.List)3 Pattern (java.util.regex.Pattern)3 NotNull (org.jetbrains.annotations.NotNull)3 Nullable (org.jetbrains.annotations.Nullable)3 LookupElementBuilder (com.intellij.codeInsight.lookup.LookupElementBuilder)2 ASTNode (com.intellij.lang.ASTNode)2 StringHelper (com.redhat.devtools.intellij.common.utils.StringHelper)2 TaskConfigurationModel (com.redhat.devtools.intellij.tektoncd.utils.model.resources.TaskConfigurationModel)2 LocalQuickFix (com.intellij.codeInspection.LocalQuickFix)1