Search in sources :

Example 1 with ConditionConfigurationModel

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

the class ConfigurationModelFactoryTest method checkConditionModelIsReturned.

@Test
public void checkConditionModelIsReturned() throws IOException {
    String configuration = load("condition1.yaml");
    ConfigurationModel model = ConfigurationModelFactory.getModel(configuration);
    assertTrue(model instanceof ConditionConfigurationModel);
}
Also used : ConditionConfigurationModel(com.redhat.devtools.intellij.tektoncd.utils.model.resources.ConditionConfigurationModel) TaskConfigurationModel(com.redhat.devtools.intellij.tektoncd.utils.model.resources.TaskConfigurationModel) PipelineConfigurationModel(com.redhat.devtools.intellij.tektoncd.utils.model.resources.PipelineConfigurationModel) ConditionConfigurationModel(com.redhat.devtools.intellij.tektoncd.utils.model.resources.ConditionConfigurationModel) Test(org.junit.Test) BaseTest(com.redhat.devtools.intellij.tektoncd.BaseTest)

Example 2 with ConditionConfigurationModel

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

the class ConditionConfigurationModelTest method checkConditionModelWithInputResources.

@Test
public void checkConditionModelWithInputResources() throws IOException {
    String configuration = load("condition2.yaml");
    ConditionConfigurationModel model = (ConditionConfigurationModel) ConfigurationModelFactory.getModel(configuration);
    assertEquals(model.getName(), "foo");
    assertEquals(model.getNamespace(), "tekton");
    assertEquals(model.getKind(), "Condition");
    assertTrue(model.getParams().isEmpty());
    assertTrue(model.getInputResources().size() == 1);
    assertEquals(model.getInputResources().get(0).name(), "workspace");
    assertEquals(model.getInputResources().get(0).type(), "git");
    assertTrue(model.getOutputResources().isEmpty());
    assertTrue(model.getWorkspaces().isEmpty());
}
Also used : ConditionConfigurationModel(com.redhat.devtools.intellij.tektoncd.utils.model.resources.ConditionConfigurationModel) Test(org.junit.Test) BaseTest(com.redhat.devtools.intellij.tektoncd.BaseTest)

Example 3 with ConditionConfigurationModel

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

the class ConditionConfigurationModelTest method checkConditionModelWithParams.

@Test
public void checkConditionModelWithParams() throws IOException {
    String configuration = load("condition1.yaml");
    ConditionConfigurationModel model = (ConditionConfigurationModel) ConfigurationModelFactory.getModel(configuration);
    assertEquals(model.getName(), "foo");
    assertEquals(model.getNamespace(), "tekton");
    assertEquals(model.getKind(), "Condition");
    assertTrue(model.getParams().size() == 1);
    assertEquals(model.getParams().get(0).name(), "path");
    assertTrue(model.getInputResources().isEmpty());
    assertTrue(model.getOutputResources().isEmpty());
    assertTrue(model.getWorkspaces().isEmpty());
}
Also used : ConditionConfigurationModel(com.redhat.devtools.intellij.tektoncd.utils.model.resources.ConditionConfigurationModel) Test(org.junit.Test) BaseTest(com.redhat.devtools.intellij.tektoncd.BaseTest)

Example 4 with ConditionConfigurationModel

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

the class ConditionConfigurationModelTest method checkEmptyConditionModel.

@Test
public void checkEmptyConditionModel() throws IOException {
    String configuration = load("condition.yaml");
    ConditionConfigurationModel model = (ConditionConfigurationModel) ConfigurationModelFactory.getModel(configuration);
    assertEquals(model.getName(), "foo");
    assertEquals(model.getNamespace(), "tekton");
    assertEquals(model.getKind(), "Condition");
    assertTrue(model.getParams().isEmpty());
    assertTrue(model.getInputResources().isEmpty());
    assertTrue(model.getOutputResources().isEmpty());
    assertTrue(model.getWorkspaces().isEmpty());
}
Also used : ConditionConfigurationModel(com.redhat.devtools.intellij.tektoncd.utils.model.resources.ConditionConfigurationModel) Test(org.junit.Test) BaseTest(com.redhat.devtools.intellij.tektoncd.BaseTest)

Example 5 with ConditionConfigurationModel

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

the class ConditionConfigurationModelTest method checkConditionModelWithMultipleInputs.

@Test
public void checkConditionModelWithMultipleInputs() throws IOException {
    String configuration = load("condition3.yaml");
    ConditionConfigurationModel model = (ConditionConfigurationModel) ConfigurationModelFactory.getModel(configuration);
    assertEquals(model.getName(), "foo");
    assertEquals(model.getNamespace(), "tekton");
    assertEquals(model.getKind(), "Condition");
    assertTrue(model.getParams().size() == 1);
    assertEquals(model.getParams().get(0).name(), "path");
    assertTrue(model.getInputResources().size() == 1);
    assertEquals(model.getInputResources().get(0).name(), "workspace");
    assertEquals(model.getInputResources().get(0).type(), "git");
    assertTrue(model.getOutputResources().isEmpty());
    assertTrue(model.getWorkspaces().isEmpty());
}
Also used : ConditionConfigurationModel(com.redhat.devtools.intellij.tektoncd.utils.model.resources.ConditionConfigurationModel) Test(org.junit.Test) BaseTest(com.redhat.devtools.intellij.tektoncd.BaseTest)

Aggregations

BaseTest (com.redhat.devtools.intellij.tektoncd.BaseTest)5 ConditionConfigurationModel (com.redhat.devtools.intellij.tektoncd.utils.model.resources.ConditionConfigurationModel)5 Test (org.junit.Test)5 PipelineConfigurationModel (com.redhat.devtools.intellij.tektoncd.utils.model.resources.PipelineConfigurationModel)1 TaskConfigurationModel (com.redhat.devtools.intellij.tektoncd.utils.model.resources.TaskConfigurationModel)1