func TestNewTaskStatus(t *testing.T) { status := NewTaskStatus(NewTaskID("task-1"), mesos.TaskState_TASK_RUNNING) if status == nil { t.Fatal("Not creating protobuf object TaskStatus") } if status.GetTaskId().GetValue() != "task-1" { t.Fatal("Protobuf object TaskStatus.TaskId missing.") } if status.GetState() != mesos.TaskState(mesos.TaskState_TASK_RUNNING) { t.Fatal("Protobuf object TaskStatus.State missing.") } }
func NewTaskStatus(taskId *mesos.TaskID, state mesos.TaskState) *mesos.TaskStatus { return &mesos.TaskStatus{ TaskId: taskId, State: mesos.TaskState(state).Enum(), } }