55 "net/http/httptest"
66 "strings"
77 "testing"
8+ "time"
89
910 "github.com/labstack/echo/v4"
1011 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -37,8 +38,9 @@ func newRuntimeBindingsTestServer(t *testing.T, objects ...*spritzv1.Spritz) *se
3738func TestGetRuntimeBindingReturnsCanonicalFacts (t * testing.T ) {
3839 spritz := & spritzv1.Spritz {
3940 ObjectMeta : metav1.ObjectMeta {
40- Name : "zeno-delta-breeze" ,
41- Namespace : "spritz-production" ,
41+ Name : "zeno-delta-breeze" ,
42+ Namespace : "spritz-production" ,
43+ CreationTimestamp : metav1 .NewTime (time .Date (2026 , time .March , 30 , 12 , 34 , 56 , 0 , time .UTC )),
4244 Annotations : map [string ]string {
4345 presetIDAnnotationKey : "zeno" ,
4446 instanceClassAnnotationKey : "personal-agent" ,
@@ -73,6 +75,7 @@ func TestGetRuntimeBindingReturnsCanonicalFacts(t *testing.T) {
7375 `"serviceAccountName":"zeno-agent-abcd1234"` ,
7476 `"presetId":"zeno"` ,
7577 `"instanceClassId":"personal-agent"` ,
78+ `"createdAt":"2026-03-30T12:34:56Z"` ,
7679 }
7780 for _ , fragment := range expectedFragments {
7881 if ! strings .Contains (rec .Body .String (), fragment ) {
@@ -84,8 +87,9 @@ func TestGetRuntimeBindingReturnsCanonicalFacts(t *testing.T) {
8487func TestGetRuntimeBindingRejectsMissingServiceAccountName (t * testing.T ) {
8588 spritz := & spritzv1.Spritz {
8689 ObjectMeta : metav1.ObjectMeta {
87- Name : "openclaw-morning-sky" ,
88- Namespace : "spritz-production" ,
90+ Name : "openclaw-morning-sky" ,
91+ Namespace : "spritz-production" ,
92+ CreationTimestamp : metav1 .NewTime (time .Date (2026 , time .March , 30 , 12 , 34 , 56 , 0 , time .UTC )),
8993 Annotations : map [string ]string {
9094 presetIDAnnotationKey : "openclaw" ,
9195 instanceClassAnnotationKey : "assistant-runtime" ,
@@ -112,8 +116,9 @@ func TestGetRuntimeBindingRejectsMissingServiceAccountName(t *testing.T) {
112116func TestGetRuntimeBindingRejectsIncompleteBinding (t * testing.T ) {
113117 spritz := & spritzv1.Spritz {
114118 ObjectMeta : metav1.ObjectMeta {
115- Name : "zeno-delta-breeze" ,
116- Namespace : "spritz-production" ,
119+ Name : "zeno-delta-breeze" ,
120+ Namespace : "spritz-production" ,
121+ CreationTimestamp : metav1 .NewTime (time .Date (2026 , time .March , 30 , 12 , 34 , 56 , 0 , time .UTC )),
117122 Annotations : map [string ]string {
118123 presetIDAnnotationKey : "zeno" ,
119124 },
@@ -141,8 +146,9 @@ func TestGetRuntimeBindingRejectsIncompleteBinding(t *testing.T) {
141146func TestGetRuntimeBindingRejectsNamespaceOutsideServerScope (t * testing.T ) {
142147 spritz := & spritzv1.Spritz {
143148 ObjectMeta : metav1.ObjectMeta {
144- Name : "zeno-delta-breeze" ,
145- Namespace : "spritz-production" ,
149+ Name : "zeno-delta-breeze" ,
150+ Namespace : "spritz-production" ,
151+ CreationTimestamp : metav1 .NewTime (time .Date (2026 , time .March , 30 , 12 , 34 , 56 , 0 , time .UTC )),
146152 Annotations : map [string ]string {
147153 presetIDAnnotationKey : "zeno" ,
148154 instanceClassAnnotationKey : "personal-agent" ,
0 commit comments