From 181e96e5122fc800cee987869db2fa7ca336e696 Mon Sep 17 00:00:00 2001 From: Cindy Pallares Date: Wed, 2 Aug 2023 19:14:22 +0000 Subject: [PATCH] Fix datasource cache test formatting --- datasource_cache_test.go | 64 ++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/datasource_cache_test.go b/datasource_cache_test.go index 17e007db..377b4338 100644 --- a/datasource_cache_test.go +++ b/datasource_cache_test.go @@ -7,29 +7,31 @@ import ( ) const ( - getDatasourceCacheJSON = `{ - "message": "Data source cache settings loaded", - "dataSourceID": 1, - "dataSourceUID": "jZrmlLCGka", - "enabled": true, - "useDefaultTTL": false, - "ttlQueriesMs": 60000, - "ttlResourcesMs": 300000, - "defaultTTLMs": 300000, - "created": "2023-04-21T11:49:22-04:00", - "updated": "2023-04-24T17:03:40-04:00" + getDatasourceCacheJSON = ` + { + "message": "Data source cache settings loaded", + "dataSourceID": 1, + "dataSourceUID": "jZrmlLCGka", + "enabled": true, + "useDefaultTTL": false, + "ttlQueriesMs": 60000, + "ttlResourcesMs": 300000, + "defaultTTLMs": 300000, + "created": "2023-04-21T11:49:22-04:00", + "updated": "2023-04-24T17:03:40-04:00" }` - updateDatasourceCacheJSON = `{ - "message": "Data source cache settings updated", - "dataSourceID": 1, - "dataSourceUID": "jZrmlLCGka", - "enabled": true, - "useDefaultTTL": false, - "ttlQueriesMs": 60000, - "ttlResourcesMs": 300000, - "defaultTTLMs": 300000, - "created": "2023-04-21T11:49:22-04:00", - "updated": "2023-04-24T17:03:40-04:00" + updateDatasourceCacheJSON = ` + { + "message": "Data source cache settings updated", + "dataSourceID": 1, + "dataSourceUID": "jZrmlLCGka", + "enabled": true, + "useDefaultTTL": false, + "ttlQueriesMs": 60000, + "ttlResourcesMs": 300000, + "defaultTTLMs": 300000, + "created": "2023-04-21T11:49:22-04:00", + "updated": "2023-04-24T17:03:40-04:00" }` ) @@ -55,16 +57,14 @@ func TestDatasourceCache(t *testing.T) { Updated: "2023-04-24T17:03:40-04:00", } - t.Run("check data", func(t *testing.T) { - if resp.Enabled != expects.Enabled || - resp.DatasourceUID != expects.DatasourceUID || - resp.UseDefaultTLS != expects.UseDefaultTLS || - resp.TTLQueriesMs != expects.TTLQueriesMs || - resp.TTLResourcesMs != expects.TTLResourcesMs || - resp.DefaultTTLMs != expects.DefaultTTLMs { - t.Error("Not correctly parsing returned datasource cache") - } - }) + if resp.Enabled != expects.Enabled || + resp.DatasourceUID != expects.DatasourceUID || + resp.UseDefaultTLS != expects.UseDefaultTLS || + resp.TTLQueriesMs != expects.TTLQueriesMs || + resp.TTLResourcesMs != expects.TTLResourcesMs || + resp.DefaultTTLMs != expects.DefaultTTLMs { + t.Error("Not correctly parsing returned datasource cache") + } } func TestUpdateDatasourceCache(t *testing.T) {