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);
}
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());
}
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());
}
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());
}
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());
}
Aggregations