11package api_test
22
33import (
4- "github.com/stretchr/testify/require"
54 "mokapi/api"
65 "mokapi/config/static"
76 "mokapi/providers/openapi"
@@ -11,6 +10,8 @@ import (
1110 "net/http"
1211 "net/http/httptest"
1312 "testing"
13+
14+ "github.com/stretchr/testify/require"
1415)
1516
1617func TestHandler_ServeHTTP (t * testing.T ) {
@@ -57,7 +58,7 @@ func TestHandler_ServeHTTP(t *testing.T) {
5758 h ,
5859 try .HasStatusCode (200 ),
5960 try .HasHeader ("Content-Type" , "application/json" ),
60- try .HasBody (`{"version":"","buildTime":"","search":{"enabled":false}}` ))
61+ try .HasBody (`{"version":"0.0.0 ","buildTime":"","search":{"enabled":false}}` ))
6162 },
6263 },
6364 {
@@ -120,7 +121,7 @@ func TestHandler_Api_Info(t *testing.T) {
120121 h ,
121122 try .HasStatusCode (200 ),
122123 try .HasHeader ("Content-Type" , "application/json" ),
123- try .HasBody (`{"version":"","buildTime":"","activeServices":["http"],"search":{"enabled":false}}` ))
124+ try .HasBody (`{"version":"0.0.0 ","buildTime":"","activeServices":["http"],"search":{"enabled":false}}` ))
124125 },
125126 },
126127 {
@@ -135,7 +136,7 @@ func TestHandler_Api_Info(t *testing.T) {
135136 h ,
136137 try .HasStatusCode (200 ),
137138 try .HasHeader ("Content-Type" , "application/json" ),
138- try .HasBody (`{"version":"","buildTime":"","activeServices":["kafka"],"search":{"enabled":false}}` ))
139+ try .HasBody (`{"version":"0.0.0 ","buildTime":"","activeServices":["kafka"],"search":{"enabled":false}}` ))
139140 },
140141 },
141142 {
@@ -150,7 +151,7 @@ func TestHandler_Api_Info(t *testing.T) {
150151 h ,
151152 try .HasStatusCode (200 ),
152153 try .HasHeader ("Content-Type" , "application/json" ),
153- try .HasBody (`{"version":"","buildTime":"","activeServices":["mail"],"search":{"enabled":false}}` ))
154+ try .HasBody (`{"version":"0.0.0 ","buildTime":"","activeServices":["mail"],"search":{"enabled":false}}` ))
154155 },
155156 },
156157 {
@@ -165,7 +166,7 @@ func TestHandler_Api_Info(t *testing.T) {
165166 h ,
166167 try .HasStatusCode (200 ),
167168 try .HasHeader ("Content-Type" , "application/json" ),
168- try .HasBody (`{"version":"","buildTime":"","activeServices":["ldap"],"search":{"enabled":false}}` ))
169+ try .HasBody (`{"version":"0.0.0 ","buildTime":"","activeServices":["ldap"],"search":{"enabled":false}}` ))
169170 },
170171 },
171172 }
@@ -204,5 +205,5 @@ func TestHandler_SearchEnabled(t *testing.T) {
204205 h ,
205206 try .HasStatusCode (200 ),
206207 try .HasHeader ("Content-Type" , "application/json" ),
207- try .HasBody (`{"version":"","buildTime":"","search":{"enabled":true}}` ))
208+ try .HasBody (`{"version":"0.0.0 ","buildTime":"","search":{"enabled":true}}` ))
208209}
0 commit comments