use of com.redhat.devtools.intellij.tektoncd.utils.model.resources.TaskConfigurationModel in project intellij-tekton by redhat-developer.
the class TaskConfigurationModelTest method checkTaskModelWithMultipleInputs.
@Test
public void checkTaskModelWithMultipleInputs() throws IOException {
String configuration = load("task14.yaml");
TaskConfigurationModel model = (TaskConfigurationModel) ConfigurationModelFactory.getModel(configuration);
assertEquals(model.getName(), "foo");
assertEquals(model.getNamespace(), "tekton");
assertEquals(model.getKind(), "Task");
assertTrue(model.getParams().size() == 1);
assertEquals(model.getParams().get(0).name(), "parm1");
assertTrue(model.getInputResources().size() == 1);
assertEquals(model.getInputResources().get(0).name(), "resource1");
assertEquals(model.getInputResources().get(0).type(), "git");
assertTrue(model.getOutputResources().size() == 2);
assertEquals(model.getOutputResources().get(0).name(), "resource1");
assertEquals(model.getOutputResources().get(0).type(), "image");
assertEquals(model.getOutputResources().get(1).name(), "resource2");
assertEquals(model.getOutputResources().get(1).type(), "image");
assertTrue(model.getWorkspaces().size() == 2);
assertEquals(model.getWorkspaces().get(0).getName(), "write-allowed");
assertEquals(model.getWorkspaces().get(1).getName(), "write-disallowed");
}
use of com.redhat.devtools.intellij.tektoncd.utils.model.resources.TaskConfigurationModel in project intellij-tekton by redhat-developer.
the class TaskConfigurationModelTest method checkEmptyTaskModel.
@Test
public void checkEmptyTaskModel() throws IOException {
String configuration = load("task1.yaml");
TaskConfigurationModel model = (TaskConfigurationModel) ConfigurationModelFactory.getModel(configuration);
assertEquals(model.getName(), "foo");
assertEquals(model.getNamespace(), "tekton");
assertEquals(model.getKind(), "Task");
assertTrue(model.getParams().isEmpty());
assertTrue(model.getInputResources().isEmpty());
assertTrue(model.getOutputResources().isEmpty());
assertTrue(model.getWorkspaces().isEmpty());
}
Aggregations