55 "testing"
66 "time"
77
8- "github.com/pborman /uuid"
8+ "github.com/google /uuid"
99 "github.com/stretchr/testify/require"
1010 "github.com/stretchr/testify/suite"
1111 persistencespb "go.temporal.io/server/api/persistence/v1"
@@ -51,29 +51,29 @@ func (s *metadataSuite) SetupTest() {
5151
5252 s .isGlobalNamespaceEnabled = true
5353 s .failoverVersionIncrement = 100
54- s .clusterName = uuid .New ()
55- s .secondClusterName = uuid .New ()
56- s .thirdClusterName = uuid .New ()
54+ s .clusterName = uuid .NewString ()
55+ s .secondClusterName = uuid .NewString ()
56+ s .thirdClusterName = uuid .NewString ()
5757
5858 clusterInfo := map [string ]ClusterInformation {
5959 s .clusterName : {
6060 Enabled : true ,
6161 InitialFailoverVersion : int64 (1 ),
62- RPCAddress : uuid .New (),
62+ RPCAddress : uuid .NewString (),
6363 ShardCount : 1 ,
6464 version : 1 ,
6565 },
6666 s .secondClusterName : {
6767 Enabled : true ,
6868 InitialFailoverVersion : int64 (4 ),
69- RPCAddress : uuid .New (),
69+ RPCAddress : uuid .NewString (),
7070 ShardCount : 2 ,
7171 version : 1 ,
7272 },
7373 s .thirdClusterName : {
7474 Enabled : true ,
7575 InitialFailoverVersion : int64 (5 ),
76- RPCAddress : uuid .New (),
76+ RPCAddress : uuid .NewString (),
7777 ShardCount : 1 ,
7878 version : 1 ,
7979 },
@@ -135,7 +135,7 @@ func (s *metadataSuite) Test_RegisterMetadataChangeCallback() {
135135}
136136
137137func (s * metadataSuite ) Test_RefreshClusterMetadata_Success () {
138- id := uuid .New ()
138+ id := uuid .NewString ()
139139 s .metadata .clusterChangeCallback [id ] = func (oldClusterMetadata map [string ]* ClusterInformation , newClusterMetadata map [string ]* ClusterInformation ) {
140140 oldMetadata , ok := oldClusterMetadata [id ]
141141 s .True (ok )
@@ -169,8 +169,8 @@ func (s *metadataSuite) Test_RefreshClusterMetadata_Success() {
169169 IsConnectionEnabled : true ,
170170 InitialFailoverVersion : 1 ,
171171 HistoryShardCount : 1 ,
172- ClusterAddress : uuid .New (),
173- HttpAddress : uuid .New (),
172+ ClusterAddress : uuid .NewString (),
173+ HttpAddress : uuid .NewString (),
174174 },
175175 Version : 1 ,
176176 },
@@ -181,8 +181,8 @@ func (s *metadataSuite) Test_RefreshClusterMetadata_Success() {
181181 IsConnectionEnabled : true ,
182182 InitialFailoverVersion : 1 ,
183183 HistoryShardCount : 1 ,
184- ClusterAddress : uuid .New (),
185- HttpAddress : uuid .New (),
184+ ClusterAddress : uuid .NewString (),
185+ HttpAddress : uuid .NewString (),
186186 Tags : map [string ]string {"test" : "test" },
187187 },
188188 Version : 2 ,
@@ -194,8 +194,8 @@ func (s *metadataSuite) Test_RefreshClusterMetadata_Success() {
194194 IsConnectionEnabled : true ,
195195 InitialFailoverVersion : 2 ,
196196 HistoryShardCount : 2 ,
197- ClusterAddress : uuid .New (),
198- HttpAddress : uuid .New (),
197+ ClusterAddress : uuid .NewString (),
198+ HttpAddress : uuid .NewString (),
199199 Tags : map [string ]string {"test" : "test" },
200200 },
201201 Version : 2 ,
@@ -211,7 +211,7 @@ func (s *metadataSuite) Test_RefreshClusterMetadata_Success() {
211211
212212func (s * metadataSuite ) Test_ListAllClusterMetadataFromDB_Success () {
213213 nextPageSizeToken := []byte {1 }
214- newClusterName := uuid .New ()
214+ newClusterName := uuid .NewString ()
215215 s .mockClusterMetadataStore .EXPECT ().ListClusterMetadata (gomock .Any (), & persistence.ListClusterMetadataRequest {
216216 PageSize : defaultClusterMetadataPageSize ,
217217 NextPageToken : nil ,
@@ -224,8 +224,8 @@ func (s *metadataSuite) Test_ListAllClusterMetadataFromDB_Success() {
224224 IsConnectionEnabled : true ,
225225 InitialFailoverVersion : 1 ,
226226 HistoryShardCount : 1 ,
227- ClusterAddress : uuid .New (),
228- HttpAddress : uuid .New (),
227+ ClusterAddress : uuid .NewString (),
228+ HttpAddress : uuid .NewString (),
229229 },
230230 Version : 1 ,
231231 },
@@ -244,8 +244,8 @@ func (s *metadataSuite) Test_ListAllClusterMetadataFromDB_Success() {
244244 IsConnectionEnabled : true ,
245245 InitialFailoverVersion : 2 ,
246246 HistoryShardCount : 2 ,
247- ClusterAddress : uuid .New (),
248- HttpAddress : uuid .New (),
247+ ClusterAddress : uuid .NewString (),
248+ HttpAddress : uuid .NewString (),
249249 },
250250 Version : 2 ,
251251 },
0 commit comments