oc-lib/models/workflow/workflow_test.go
2024-07-19 10:54:58 +02:00

30 lines
547 B
Go

package oclib
import (
"testing"
"cloud.o-forge.io/core/oc-lib/models/utils"
"github.com/stretchr/testify/assert"
)
func TestStoreOneWorkflow(t *testing.T) {
w := Workflow{
AbstractObject: utils.AbstractObject{Name: "testWorkflow"},
}
wma := WorkflowMongoAccessor{}
id, _ := wma.StoreOne(&w)
assert.NotEmpty(t, id)
}
func TestLoadOneWorkflow(t *testing.T) {
w := Workflow{
AbstractObject: utils.AbstractObject{Name: "testWorkflow"},
}
wma := WorkflowMongoAccessor{}
new_w, _ := wma.StoreOne(&w)
assert.Equal(t, w, new_w)
}