Manager: add unittest for eventbus topics

The code was doing its work just fine, but I wanted to be sure.
This commit is contained in:
Sybren A. Stüvel 2024-02-04 16:09:23 +01:00
parent dd98c7471d
commit 4f804958e5

View File

@ -0,0 +1,14 @@
package eventbus
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestParamterisedTopics(t *testing.T) {
uuid := "646f85f3-7166-40bd-9d43-d2b5baaeb42a"
assert.Equal(t, EventTopic("/jobs/646f85f3-7166-40bd-9d43-d2b5baaeb42a"), topicForJob(uuid))
assert.Equal(t, EventTopic("/jobs/646f85f3-7166-40bd-9d43-d2b5baaeb42a/last-rendered"), topicForJobLastRendered(uuid))
assert.Equal(t, EventTopic("/tasklog/646f85f3-7166-40bd-9d43-d2b5baaeb42a"), topicForTaskLog(uuid))
}