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"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestStoreOneWorkflow(t *testing.T) {
|
|
|
|
w := Workflow{
|
|
|
|
AbstractObject: utils.AbstractObject{Name: "testWorkflow"},
|
|
|
|
}
|
|
|
|
|
2024-11-28 11:05:54 +01:00
|
|
|
wma := New("", 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-11-28 11:05:54 +01:00
|
|
|
wma := New("", 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)
|
|
|
|
}
|