2024-07-19 10:54:58 +02:00
|
|
|
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"},
|
|
|
|
}
|
|
|
|
|
2024-07-31 10:07:55 +02:00
|
|
|
wma := New()
|
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-07-31 10:07:55 +02:00
|
|
|
wma := New()
|
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)
|
|
|
|
}
|