apropriate db

This commit is contained in:
mr
2024-07-18 16:46:54 +02:00
parent d273fdc57f
commit 3e9eae007b
17 changed files with 92 additions and 93 deletions

View File

@@ -1,44 +0,0 @@
package oclib
import (
"testing"
"cloud.o-forge.io/core/oc-lib/models/resources"
"github.com/stretchr/testify/assert"
)
func TestStoreOneWorkflow(t *testing.T) {
w := Workflow{AbstractResource: resources.AbstractResource{
Uuid: "123",
Name: "testWorkflow",
Description: "Lorem Ipsum",
Logo: "azerty.com",
Owner: "toto",
OwnerLogo: "totoLogo",
SourceUrl: "azerty.fr",
},
}
wma := WorkflowMongoAccessor{}
id, _ := wma.StoreOne(&w)
assert.NotEmpty(t, id)
}
func TestLoadOneWorkflow(t *testing.T) {
w := Workflow{AbstractResource: resources.AbstractResource{
Uuid: "123",
Name: "testWorkflow",
Description: "Lorem Ipsum",
Logo: "azerty.com",
Owner: "toto",
OwnerLogo: "totoLogo",
SourceUrl: "azerty.fr",
},
}
wma := WorkflowMongoAccessor{}
new_w, _ := wma.StoreOne(&w)
assert.Equal(t, w, new_w)
}