2024-08-30 09:14:03 +02:00
|
|
|
package workflow
|
2024-07-19 10:54:58 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"cloud.o-forge.io/core/oc-lib/models/utils"
|
2024-11-28 13:19:01 +01:00
|
|
|
"cloud.o-forge.io/core/oc-lib/tools"
|
2024-07-19 10:54:58 +02:00
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestStoreOneWorkflow(t *testing.T) {
|
|
|
|
w := Workflow{
|
|
|
|
AbstractObject: utils.AbstractObject{Name: "testWorkflow"},
|
|
|
|
}
|
|
|
|
|
2024-12-04 11:33:08 +01:00
|
|
|
wma := New(tools.WORKFLOW, "", "", nil, nil)
|
2024-07-19 11:27:58 +02:00
|
|
|
id, _, _ := wma.StoreOne(&w)
|
2024-07-19 10:54:58 +02:00
|
|
|
|
|
|
|
assert.NotEmpty(t, id)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestLoadOneWorkflow(t *testing.T) {
|
|
|
|
w := Workflow{
|
|
|
|
AbstractObject: utils.AbstractObject{Name: "testWorkflow"},
|
|
|
|
}
|
|
|
|
|
2024-12-04 11:33:08 +01:00
|
|
|
wma := New(tools.WORKFLOW, "", "", nil, nil)
|
2024-07-19 11:27:58 +02:00
|
|
|
new_w, _, _ := wma.StoreOne(&w)
|
2024-07-19 10:54:58 +02:00
|
|
|
assert.Equal(t, w, new_w)
|
|
|
|
}
|