github.com/kyma-project/kyma-environment-broker@v0.0.1/internal/cis/e2e/cis_fake_server.go (about)

     1  package e2e
     2  
     3  import (
     4  	"fmt"
     5  	"net/http"
     6  	"net/http/httptest"
     7  	"strconv"
     8  	"strings"
     9  	"testing"
    10  
    11  	"github.com/gorilla/mux"
    12  	"github.com/stretchr/testify/require"
    13  )
    14  
    15  type server struct {
    16  	t *testing.T
    17  }
    18  
    19  func newServer(t *testing.T) *server {
    20  	return &server{
    21  		t: t,
    22  	}
    23  }
    24  
    25  func fixHTTPServer(t *testing.T) *httptest.Server {
    26  	r := mux.NewRouter()
    27  	srv := newServer(t)
    28  
    29  	r.HandleFunc("/public/rest/v2/events", srv.returnCIS1Events).Methods(http.MethodGet)
    30  	r.HandleFunc("/events/v1/events/central", srv.returnCIS2Events).Methods(http.MethodGet)
    31  
    32  	return httptest.NewServer(r)
    33  }
    34  
    35  func (s *server) returnCIS1Events(w http.ResponseWriter, r *http.Request) {
    36  	eventType := r.URL.Query().Get("type")
    37  	if eventType != "MASTER_SUBACCOUNT_DELETION" {
    38  		w.WriteHeader(http.StatusNotFound)
    39  		return
    40  	}
    41  
    42  	var (
    43  		page int
    44  		size int
    45  		err  error
    46  	)
    47  
    48  	pageSize := r.URL.Query().Get("resultsPerPage")
    49  	if pageSize == "" {
    50  		size = 10
    51  	} else {
    52  		size, err = strconv.Atoi(pageSize)
    53  		require.NoError(s.t, err)
    54  	}
    55  
    56  	pageNum := r.URL.Query().Get("page")
    57  	if pageNum == "" {
    58  		page = 1
    59  	} else {
    60  		page, err = strconv.Atoi(pageNum)
    61  		require.NoError(s.t, err)
    62  	}
    63  
    64  	events := chunk(size, cis1Events())
    65  
    66  	var response = fmt.Sprintf(`{
    67  	  	"events":[%s],
    68  	  	"totalResults":30,
    69  	  	"totalPages":%d
    70  	}`, strings.Join(events[page-1], ","), len(events))
    71  
    72  	_, err = w.Write([]byte(response))
    73  	if err != nil {
    74  		s.t.Errorf("fakeCisServer (endpoint 1.0) cannot write response: %s", err)
    75  		w.WriteHeader(http.StatusInternalServerError)
    76  		return
    77  	}
    78  	w.WriteHeader(http.StatusOK)
    79  }
    80  
    81  func (s *server) returnCIS2Events(w http.ResponseWriter, r *http.Request) {
    82  	eventType := r.URL.Query().Get("eventType")
    83  	if eventType != "Subaccount_Deletion" {
    84  		w.WriteHeader(http.StatusNotFound)
    85  		return
    86  	}
    87  
    88  	var (
    89  		page int
    90  		size int
    91  		err  error
    92  	)
    93  
    94  	pageSize := r.URL.Query().Get("pageSize")
    95  	if pageSize == "" {
    96  		size = 10
    97  	} else {
    98  		size, err = strconv.Atoi(pageSize)
    99  		require.NoError(s.t, err)
   100  	}
   101  
   102  	pageNum := r.URL.Query().Get("pageNum")
   103  	if pageNum == "" {
   104  		page = 0
   105  	} else {
   106  		page, err = strconv.Atoi(pageNum)
   107  		require.NoError(s.t, err)
   108  	}
   109  
   110  	events := chunk(size, cis2Events())
   111  
   112  	// CIS 2.0 API counts pages from 0 (not from 1) - last page is always empty
   113  	events = append(events, []string{})
   114  
   115  	var response = fmt.Sprintf(`{
   116  		"total": 30,
   117  		"totalPages": %d,
   118  		"pageNum": %d,
   119  		"morePages": %t,
   120  		"events": [%s]
   121  	}`, len(events)-1, page, page < len(events)-1, strings.Join(events[page], ","))
   122  
   123  	_, err = w.Write([]byte(response))
   124  	if err != nil {
   125  		s.t.Errorf("fakeCisServer (endpoint 2.0) cannot write response: %s", err)
   126  		w.WriteHeader(http.StatusInternalServerError)
   127  		return
   128  	}
   129  	w.WriteHeader(http.StatusOK)
   130  }
   131  
   132  func chunk(amount int, data []string) [][]string {
   133  	var divided [][]string
   134  
   135  	for i := 0; i < len(data); i += amount {
   136  		end := i + amount
   137  		if end > len(data) {
   138  			end = len(data)
   139  		}
   140  		divided = append(divided, data[i:end])
   141  	}
   142  
   143  	return divided
   144  }
   145  
   146  func cis1Events() []string {
   147  	var events []string
   148  	instances := fixInstances()
   149  
   150  	for index, event := range cis1EventsData {
   151  		events = append(events, fmt.Sprintf(event, instances[index].SubAccountID))
   152  	}
   153  
   154  	return events
   155  }
   156  
   157  func cis2Events() []string {
   158  	var events []string
   159  	instances := fixInstances()
   160  
   161  	for index, event := range cis2EventsData {
   162  		events = append(events, fmt.Sprintf(event, instances[index].SubAccountID, instances[index].SubAccountID))
   163  	}
   164  
   165  	return events
   166  }
   167  
   168  var (
   169  	cis1EventsData = []string{
   170  		`{"id":145385,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597913650896","eventData":"{\"globalAccountGuid\":\"9f023be7-4678-4e24-9a39-7755ca8b6891\",\"subaccountGuid\":\"%s\",\"platformID\":\"t45a53814\",\"subdomain\":\"c20a4d11-f452-4917-a6a7-3810e5f40487\",\"region\":\"eu2-canary\"}"}`,
   171  		`{"id":145383,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597913624896","eventData":"{\"globalAccountGuid\":\"cb76a519-79b4-4d66-bbd9-0bc4a82ced26\",\"subaccountGuid\":\"%s\",\"platformID\":\"8d7e4b47-6b67-49a7-b1d6-6ffe0423ee30\",\"subdomain\":\"dev-tenant-2\",\"region\":\"eu10-canary\"}"}`,
   172  		`{"id":145382,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597912900232","eventData":"{\"globalAccountGuid\":\"e065f1b9-94fc-4494-a009-ceb1cd7bc779\",\"subaccountGuid\":\"%s\",\"platformID\":\"2e97e6d7-7980-4f6c-84ed-31afef059907\",\"subdomain\":\"OQ-toni\",\"region\":\"eu10-canary\"}"}`,
   173  		`{"id":145381,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597912674809","eventData":"{\"globalAccountGuid\":\"almts\",\"subaccountGuid\":\"%s\",\"platformID\":\"a5392d50-1fca-460b-8d2f-7aea45950ae8\",\"subdomain\":\"orphantest\",\"region\":\"eu10-canary\"}"}`,
   174  		`{"id":145380,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597912194772","eventData":"{\"globalAccountGuid\":\"27c2ccb8-8916-a1e6-18af-99007dee6639\",\"subaccountGuid\":\"%s\",\"platformID\":\"b0c4bf65-804e-4c5d-935d-b54ef7a3c95e\",\"subdomain\":\"CustomUI\",\"region\":\"eu10-canary\"}"}`,
   175  		`{"id":145379,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597911775006","eventData":"{\"globalAccountGuid\":\"d4037436-f01a-4adc-aa2b-52836f459bfe\",\"subaccountGuid\":\"%s\",\"platformID\":\"1cb359a3-2d83-44f7-8ddb-2195fcba2f94\",\"subdomain\":\"release1-15rc1-test\",\"region\":\"eu10-canary\"}"}`,
   176  		`{"id":145378,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597911149713","eventData":"{\"globalAccountGuid\":\"1f599a9e-ab04-4948-809e-e8341f8e8eec\",\"subaccountGuid\":\"%s\",\"platformID\":\"bl9r8oey00\",\"subdomain\":\"057792f5-6b7a-4f58-a9ae-858025be9dd7\",\"region\":\"eu2-canary\"}"}`,
   177  		`{"id":145375,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597909968182","eventData":"{\"globalAccountGuid\":\"almts\",\"subaccountGuid\":\"%s\",\"platformID\":\"905b276d-5fbd-42c2-9dff-32ed80482bd0\",\"subdomain\":\"unsubscribed\",\"region\":\"eu10-canary\"}"}`,
   178  		`{"id":145374,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597909558868","eventData":"{\"globalAccountGuid\":\"b13eaa86-b117-406e-ac1d-0930b471d732\",\"subaccountGuid\":\"%s\",\"platformID\":\"bdfdd276-b8f4-4a18-af10-8bcebd4bd6b6\",\"subdomain\":\"sec-si-dec\",\"region\":\"eu10-canary\"}"}`,
   179  		`{"id":145371,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597909023236","eventData":"{\"globalAccountGuid\":\"6b04f2ee-f31a-450d-bf56-c802c7120f03\",\"subaccountGuid\":\"%s\",\"platformID\":\"9253015b-22f3-4fb3-a59f-58b2d85d0954\",\"subdomain\":\"testprovsetup\",\"region\":\"eu10-canary\"}"}`,
   180  		`{"id":145369,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597908235870","eventData":"{\"globalAccountGuid\":\"9f023be7-4678-4e24-9a39-7755ca8b6891\",\"subaccountGuid\":\"%s\",\"platformID\":\"t32a20882\",\"subdomain\":\"6974742f-17bf-4a9a-9985-5d8b6f2630ac\",\"region\":\"eu2-canary\"}"}`,
   181  		`{"id":145368,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597907366152","eventData":"{\"globalAccountGuid\":\"bpm\",\"subaccountGuid\":\"%s\",\"platformID\":\"tbbe19c7f\",\"subdomain\":\"d3a95b20-86d2-4d75-9a77-4637bb3397b7\",\"region\":\"eu2-canary\"}"}`,
   182  		`{"id":145367,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597907126299","eventData":"{\"globalAccountGuid\":\"bpm\",\"subaccountGuid\":\"%s\",\"platformID\":\"tcce6ace9\",\"subdomain\":\"0ddd2512-8ef0-4a0d-a0c2-4f4b2ec62213\",\"region\":\"eu2-canary\"}"}`,
   183  		`{"id":145366,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597906863271","eventData":"{\"globalAccountGuid\":\"22cb7ffd-6f53-4b94-9915-b8a6dc6038f3\",\"subaccountGuid\":\"%s\",\"platformID\":\"8e8b4231-0224-441e-a017-234cdccd816e\",\"subdomain\":\"procurepartobedeleted\",\"region\":\"eu10-canary\"}"}`,
   184  		`{"id":145365,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597906758247","eventData":"{\"globalAccountGuid\":\"22cb7ffd-6f53-4b94-9915-b8a6dc6038f3\",\"subaccountGuid\":\"%s\",\"platformID\":\"064adad0-6d0c-4afb-8439-6095d86d4dfd\",\"subdomain\":\"procurepardevc4\",\"region\":\"eu10-canary\"}"}`,
   185  		`{"id":145364,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597906403195","eventData":"{\"globalAccountGuid\":\"423e5e64-1b67-474b-87ae-8c84070cdcaa\",\"subaccountGuid\":\"%s\",\"platformID\":\"4ae3bbb3-dc96-47b5-81f9-66b5fa030b11\",\"subdomain\":\"iotae-hotfixtmtest01\",\"region\":\"eu10-canary\"}"}`,
   186  		`{"id":145363,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597906383102","eventData":"{\"globalAccountGuid\":\"423e5e64-1b67-474b-87ae-8c84070cdcaa\",\"subaccountGuid\":\"%s\",\"platformID\":\"2838513a-2585-4e98-b322-fac75345cf44\",\"subdomain\":\"iotae-hotfixtmtest02\",\"region\":\"eu10-canary\"}"}`,
   187  		`{"id":145362,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597906343187","eventData":"{\"globalAccountGuid\":\"423e5e64-1b67-474b-87ae-8c84070cdcaa\",\"subaccountGuid\":\"%s\",\"platformID\":\"e415c820-7895-41da-91cd-8f82a2b6f469\",\"subdomain\":\"iotae-hotfixtmtest03\",\"region\":\"eu10-canary\"}"}`,
   188  		`{"id":145361,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597905288293","eventData":"{\"globalAccountGuid\":\"9cae2ea3-f827-4e81-ad87-d354c9e376a8\",\"subaccountGuid\":\"%s\",\"platformID\":\"704548cc-5fdc-47e5-b03d-15445fb102f4\",\"subdomain\":\"irpachallenge--demo\",\"region\":\"eu10-canary\"}"}`,
   189  		`{"id":145360,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597902683098","eventData":"{\"globalAccountGuid\":\"cloudfnddm\",\"subaccountGuid\":\"%s\",\"platformID\":\"3ec68e7e-4c19-4c08-a417-680d7885d6ae\",\"subdomain\":\"AtestUnsubs\",\"region\":\"eu10-canary\"}"}`,
   190  		`{"id":145359,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597898786106","eventData":"{\"globalAccountGuid\":\"bpm\",\"subaccountGuid\":\"%s\",\"platformID\":\"t5c59b178\",\"subdomain\":\"8d0f80c4-5780-4678-a2c3-4bc80dd46331\",\"region\":\"eu2-canary\"}"}`,
   191  		`{"id":145358,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597898546100","eventData":"{\"globalAccountGuid\":\"bpm\",\"subaccountGuid\":\"%s\",\"platformID\":\"t2b5e81ee\",\"subdomain\":\"83cfd327-b0f4-4036-87cf-48c58e0990ef\",\"region\":\"eu2-canary\"}"}`,
   192  		`{"id":145357,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597885135909","eventData":"{\"globalAccountGuid\":\"d2721a72-d9e1-40cb-ae73-53152254d8c1\",\"subaccountGuid\":\"%s\",\"platformID\":\"tc550e0c2\",\"subdomain\":\"a52f5dd6-314a-49a8-876f-10d0abefde1f\",\"region\":\"eu2-canary\"}"}`,
   193  		`{"id":145356,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597885106144","eventData":"{\"globalAccountGuid\":\"d2721a72-d9e1-40cb-ae73-53152254d8c1\",\"subaccountGuid\":\"%s\",\"platformID\":\"tb257d054\",\"subdomain\":\"01e7a8ef-4fd9-42d0-806b-122d727d7935\",\"region\":\"eu2-canary\"}"}`,
   194  		`{"id":145355,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597885075934","eventData":"{\"globalAccountGuid\":\"0d72937a-4797-41ea-8c9c-95ed2e4f9823\",\"subaccountGuid\":\"%s\",\"platformID\":\"t2c3345f7\",\"subdomain\":\"e4535720-55c8-4cd4-8ca4-af4f19facc11\",\"region\":\"eu2-canary\"}"}`,
   195  		`{"id":145354,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597884986187","eventData":"{\"globalAccountGuid\":\"0d72937a-4797-41ea-8c9c-95ed2e4f9823\",\"subaccountGuid\":\"%s\",\"platformID\":\"t5b347561\",\"subdomain\":\"df952150-386b-4e37-ac2c-011fd51953fb\",\"region\":\"eu2-canary\"}"}`,
   196  		`{"id":145353,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597884866410","eventData":"{\"globalAccountGuid\":\"0d72937a-4797-41ea-8c9c-95ed2e4f9823\",\"subaccountGuid\":\"%s\",\"platformID\":\"tc23d24db\",\"subdomain\":\"7b86bd36-8170-4adf-9948-827edd22a532\",\"region\":\"eu2-canary\"}"}`,
   197  		`{"id":145352,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597884776402","eventData":"{\"globalAccountGuid\":\"0d72937a-4797-41ea-8c9c-95ed2e4f9823\",\"subaccountGuid\":\"%s\",\"platformID\":\"tb53a144d\",\"subdomain\":\"c3e48642-28a7-43f8-9b64-1bfd8dbde12a\",\"region\":\"eu2-canary\"}"}`,
   198  		`{"id":145351,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597884686329","eventData":"{\"globalAccountGuid\":\"d2721a72-d9e1-40cb-ae73-53152254d8c1\",\"subaccountGuid\":\"%s\",\"platformID\":\"td5fd9da8\",\"subdomain\":\"54a1e542-964e-4f28-a366-0310e525f598\",\"region\":\"eu2-canary\"}"}`,
   199  		`{"id":145350,"type":"MASTER_SUBACCOUNT_DELETION","timestamp":"1597884596099","eventData":"{\"globalAccountGuid\":\"d2721a72-d9e1-40cb-ae73-53152254d8c1\",\"subaccountGuid\":\"%s\",\"platformID\":\"ta2faad3e\",\"subdomain\":\"87b1d6f1-6a41-46bb-bf19-dc655ae241a8\",\"region\":\"eu2-canary\"}"}`,
   200  	}
   201  	cis2EventsData = []string{
   202  		`{
   203  			"id": 639589,
   204  			"actionTime": 1597322741353,
   205  			"creationTime": 1597322742088,
   206  			"details": {
   207  				"description": "Subaccount deleted.",
   208  				"guid": "%s",
   209  				"parentGuid": "732aa8c5-d8dd-42a8-b0c4-90e6267b3016",
   210  				"displayName": "TrialSub1",
   211  				"subaccountDescription": null,
   212  				"region": "eu10-canary",
   213  				"jobLocation": null,
   214  				"subdomain": "dom38484",
   215  				"betaEnabled": false,
   216  				"expiryDate": null
   217  			},
   218  			"globalAccountGUID": "732aa8c5-d8dd-42a8-b0c4-90e6267b3016",
   219  			"entityId": "%s",
   220  			"entityType": "Subaccount",
   221  			"eventOrigin": "accounts-service",
   222  			"eventType": "Subaccount_Deletion"
   223  		}`,
   224  		`{
   225  			"id": 639522,
   226  			"actionTime": 1597321854357,
   227  			"creationTime": 1597321855065,
   228  			"details": {
   229  				"description": "Subaccount deleted.",
   230  				"guid": "%s",
   231  				"parentGuid": "6b4c5e5a-b4a1-4137-9d59-5cf62fbe2fab",
   232  				"displayName": "trial",
   233  				"subaccountDescription": null,
   234  				"region": "eu10-canary",
   235  				"jobLocation": null,
   236  				"subdomain": "89558c4btrial",
   237  				"betaEnabled": false,
   238  				"expiryDate": null
   239  			},
   240  			"globalAccountGUID": "6b4c5e5a-b4a1-4137-9d59-5cf62fbe2fab",
   241  			"entityId": "%s",
   242  			"entityType": "Subaccount",
   243  			"eventOrigin": "accounts-service",
   244  			"eventType": "Subaccount_Deletion"
   245  		}`,
   246  		`{
   247  			"id": 638858,
   248  			"actionTime": 1597311078287,
   249  			"creationTime": 1597311079078,
   250  			"details": {
   251  				"description": "Subaccount deleted.",
   252  				"guid": "%s",
   253  				"parentGuid": "a45a997b-a426-41b5-853e-470d59412956",
   254  				"displayName": "trial",
   255  				"subaccountDescription": null,
   256  				"region": "eu10-canary",
   257  				"jobLocation": null,
   258  				"subdomain": "02553d35trial",
   259  				"betaEnabled": false,
   260  				"expiryDate": null
   261  			},
   262  			"globalAccountGUID": "a45a997b-a426-41b5-853e-470d59412956",
   263  			"entityId": "%s",
   264  			"entityType": "Subaccount",
   265  			"eventOrigin": "accounts-service",
   266  			"eventType": "Subaccount_Deletion"
   267  		}`,
   268  		`{
   269  			"id": 631087,
   270  			"actionTime": 1597135762286,
   271  			"creationTime": 1597135763081,
   272  			"details": {
   273  				"description": "Subaccount deleted.",
   274  				"guid": "%s",
   275  				"parentGuid": "a6c5f1b0-9713-45fc-a831-ed0057a7925c",
   276  				"displayName": "trial",
   277  				"subaccountDescription": null,
   278  				"region": "eu10-canary",
   279  				"jobLocation": null,
   280  				"subdomain": "e8b84ae5trial",
   281  				"betaEnabled": false,
   282  				"expiryDate": null
   283  			},
   284  			"globalAccountGUID": "a6c5f1b0-9713-45fc-a831-ed0057a7925c",
   285  			"entityId": "%s",
   286  			"entityType": "Subaccount",
   287  			"eventOrigin": "accounts-service",
   288  			"eventType": "Subaccount_Deletion"
   289  		}`,
   290  		`{
   291  			"id": 629225,
   292  			"actionTime": 1597090087820,
   293  			"creationTime": 1597090088405,
   294  			"details": {
   295  				"description": "Subaccount deleted.",
   296  				"guid": "%s",
   297  				"parentGuid": "ec0a066a-60a1-4d31-b329-80cf97292789",
   298  				"displayName": "Vered-Neo1",
   299  				"subaccountDescription": null,
   300  				"region": "eu1-canary",
   301  				"jobLocation": null,
   302  				"subdomain": "74eb3e9f-d8f5-4dc9-b2fe-5a5c061487c2",
   303  				"betaEnabled": false,
   304  				"expiryDate": null
   305  			},
   306  			"globalAccountGUID": "ec0a066a-60a1-4d31-b329-80cf97292789",
   307  			"entityId": "%s",
   308  			"entityType": "Subaccount",
   309  			"eventOrigin": "accounts-service",
   310  			"eventType": "Subaccount_Deletion"
   311  		}`,
   312  		`{
   313  			"id": 629224,
   314  			"actionTime": 1597090066116,
   315  			"creationTime": 1597090067309,
   316  			"details": {
   317  				"description": "Subaccount deleted.",
   318  				"guid": "%s",
   319  				"parentGuid": "ec0a066a-60a1-4d31-b329-80cf97292789",
   320  				"displayName": "anatneo",
   321  				"subaccountDescription": null,
   322  				"region": "eu1-canary",
   323  				"jobLocation": null,
   324  				"subdomain": "095db937-725d-4ce6-b802-ce33403e90d1",
   325  				"betaEnabled": false,
   326  				"expiryDate": null
   327  			},
   328  			"globalAccountGUID": "ec0a066a-60a1-4d31-b329-80cf97292789",
   329  			"entityId": "%s",
   330  			"entityType": "Subaccount",
   331  			"eventOrigin": "accounts-service",
   332  			"eventType": "Subaccount_Deletion"
   333  		}`,
   334  		`{
   335  			"id": 628876,
   336  			"actionTime": 1597073092177,
   337  			"creationTime": 1597073093081,
   338  			"details": {
   339  				"description": "Subaccount deleted.",
   340  				"guid": "%s",
   341  				"parentGuid": "22b09b03-9e8b-4739-ab85-85d8ba97bd1d",
   342  				"displayName": "trial",
   343  				"subaccountDescription": null,
   344  				"region": "eu10-canary",
   345  				"jobLocation": null,
   346  				"subdomain": "39ea0bfetrial",
   347  				"betaEnabled": false,
   348  				"expiryDate": null
   349  			},
   350  			"globalAccountGUID": "22b09b03-9e8b-4739-ab85-85d8ba97bd1d",
   351  			"entityId": "%s",
   352  			"entityType": "Subaccount",
   353  			"eventOrigin": "accounts-service",
   354  			"eventType": "Subaccount_Deletion"
   355  		}`,
   356  		`{
   357  			"id": 627716,
   358  			"actionTime": 1597047718328,
   359  			"creationTime": 1597047719085,
   360  			"details": {
   361  				"description": "Subaccount deleted.",
   362  				"guid": "%s",
   363  				"parentGuid": "96d19f17-a121-4419-80b1-dbec3233b5ca",
   364  				"displayName": "trial",
   365  				"subaccountDescription": null,
   366  				"region": "eu10-canary",
   367  				"jobLocation": null,
   368  				"subdomain": "b63f3421trial",
   369  				"betaEnabled": false,
   370  				"expiryDate": null
   371  			},
   372  			"globalAccountGUID": "96d19f17-a121-4419-80b1-dbec3233b5ca",
   373  			"entityId": "%s",
   374  			"entityType": "Subaccount",
   375  			"eventOrigin": "accounts-service",
   376  			"eventType": "Subaccount_Deletion"
   377  		}`,
   378  		`{
   379  			"id": 625718,
   380  			"actionTime": 1596960307478,
   381  			"creationTime": 1596960308089,
   382  			"details": {
   383  				"description": "Subaccount deleted.",
   384  				"guid": "%s",
   385  				"parentGuid": "9d12a33c-5a9c-4322-b24c-d453e79c0ba3",
   386  				"displayName": "Account-Dev",
   387  				"subaccountDescription": "Development Subaccount",
   388  				"region": "eu10-canary",
   389  				"jobLocation": null,
   390  				"subdomain": "398648d5-dff1-4308-8e81-3428b53c92f7",
   391  				"betaEnabled": false,
   392  				"expiryDate": null
   393  			},
   394  			"globalAccountGUID": "9d12a33c-5a9c-4322-b24c-d453e79c0ba3",
   395  			"entityId": "%s",
   396  			"entityType": "Subaccount",
   397  			"eventOrigin": "accounts-service",
   398  			"eventType": "Subaccount_Deletion"
   399  		}`,
   400  		`{
   401  			"id": 621236,
   402  			"actionTime": 1596792581434,
   403  			"creationTime": 1596792582331,
   404  			"details": {
   405  				"description": "Subaccount deleted.",
   406  				"guid": "%s",
   407  				"parentGuid": "9d12a33c-5a9c-4322-b24c-d453e79c0ba3",
   408  				"displayName": "Account-Dev",
   409  				"subaccountDescription": "Development Subaccount",
   410  				"region": "eu10-canary",
   411  				"jobLocation": null,
   412  				"subdomain": "09836aac-92cd-4a37-a28d-6b53521cc6ad",
   413  				"betaEnabled": false,
   414  				"expiryDate": null
   415  			},
   416  			"globalAccountGUID": "9d12a33c-5a9c-4322-b24c-d453e79c0ba3",
   417  			"entityId": "%s",
   418  			"entityType": "Subaccount",
   419  			"eventOrigin": "accounts-service",
   420  			"eventType": "Subaccount_Deletion"
   421  		}`,
   422  		`{
   423  			"id": 617314,
   424  			"actionTime": 1596695398708,
   425  			"creationTime": 1596695399299,
   426  			"details": {
   427  				"description": "Subaccount deleted.",
   428  				"guid": "%s",
   429  				"parentGuid": "2d7ef7c1-9895-4d10-ba34-54246cd1f6f3",
   430  				"displayName": "trial",
   431  				"subaccountDescription": null,
   432  				"region": "eu10-canary",
   433  				"jobLocation": null,
   434  				"subdomain": "ef316e53trial",
   435  				"betaEnabled": false,
   436  				"expiryDate": null
   437  			},
   438  			"globalAccountGUID": "2d7ef7c1-9895-4d10-ba34-54246cd1f6f3",
   439  			"entityId": "%s",
   440  			"entityType": "Subaccount",
   441  			"eventOrigin": "accounts-service",
   442  			"eventType": "Subaccount_Deletion"
   443  		}`,
   444  		`{
   445  			"id": 615041,
   446  			"actionTime": 1596630357377,
   447  			"creationTime": 1596630358080,
   448  			"details": {
   449  				"description": "Subaccount deleted.",
   450  				"guid": "%s",
   451  				"parentGuid": "9490f34d-6cd7-4d89-bf6b-e03c694a720c",
   452  				"displayName": "Test_ME",
   453  				"subaccountDescription": null,
   454  				"region": "eu10-canary",
   455  				"jobLocation": null,
   456  				"subdomain": "TEST-ME-SPC-CLD",
   457  				"betaEnabled": false,
   458  				"expiryDate": null
   459  			},
   460  			"globalAccountGUID": "9490f34d-6cd7-4d89-bf6b-e03c694a720c",
   461  			"entityId": "%s",
   462  			"entityType": "Subaccount",
   463  			"eventOrigin": "accounts-service",
   464  			"eventType": "Subaccount_Deletion"
   465  		}`,
   466  		`{
   467  			"id": 614985,
   468  			"actionTime": 1596629729399,
   469  			"creationTime": 1596629730104,
   470  			"details": {
   471  				"description": "Subaccount deleted.",
   472  				"guid": "%s",
   473  				"parentGuid": "ee2cdb33-3f98-4108-8c40-4e1870a6ecd5",
   474  				"displayName": "i501632-fuck",
   475  				"subaccountDescription": null,
   476  				"region": "eu10-canary",
   477  				"jobLocation": null,
   478  				"subdomain": "i501632-fuck",
   479  				"betaEnabled": false,
   480  				"expiryDate": null
   481  			},
   482  			"globalAccountGUID": "ee2cdb33-3f98-4108-8c40-4e1870a6ecd5",
   483  			"entityId": "%s",
   484  			"entityType": "Subaccount",
   485  			"eventOrigin": "accounts-service",
   486  			"eventType": "Subaccount_Deletion"
   487  		}`,
   488  		`{
   489  			"id": 614067,
   490  			"actionTime": 1596615922755,
   491  			"creationTime": 1596615923310,
   492  			"details": {
   493  				"description": "Subaccount deleted.",
   494  				"guid": "%s",
   495  				"parentGuid": "c0f22882-1ea0-4f8b-a850-a2b83226d307",
   496  				"displayName": "trial",
   497  				"subaccountDescription": null,
   498  				"region": "eu10-canary",
   499  				"jobLocation": null,
   500  				"subdomain": "048025d8trial",
   501  				"betaEnabled": false,
   502  				"expiryDate": null
   503  			},
   504  			"globalAccountGUID": "c0f22882-1ea0-4f8b-a850-a2b83226d307",
   505  			"entityId": "%s",
   506  			"entityType": "Subaccount",
   507  			"eventOrigin": "accounts-service",
   508  			"eventType": "Subaccount_Deletion"
   509  		}`,
   510  		`{
   511  			"id": 614064,
   512  			"actionTime": 1596615909394,
   513  			"creationTime": 1596615910266,
   514  			"details": {
   515  				"description": "Subaccount deleted.",
   516  				"guid": "%s",
   517  				"parentGuid": "c0f22882-1ea0-4f8b-a850-a2b83226d307",
   518  				"displayName": "nabeel-test",
   519  				"subaccountDescription": null,
   520  				"region": "eu10-canary",
   521  				"jobLocation": null,
   522  				"subdomain": "nabeeltestt",
   523  				"betaEnabled": false,
   524  				"expiryDate": null
   525  			},
   526  			"globalAccountGUID": "c0f22882-1ea0-4f8b-a850-a2b83226d307",
   527  			"entityId": "%s",
   528  			"entityType": "Subaccount",
   529  			"eventOrigin": "accounts-service",
   530  			"eventType": "Subaccount_Deletion"
   531  		}`,
   532  		`{
   533  			"id": 609957,
   534  			"actionTime": 1596522951476,
   535  			"creationTime": 1596522952233,
   536  			"details": {
   537  				"description": "Subaccount deleted.",
   538  				"guid": "%s",
   539  				"parentGuid": "e63bd660-35f6-48d4-bf2a-8b77233b947e",
   540  				"displayName": "z_sa",
   541  				"subaccountDescription": null,
   542  				"region": "eu10-canary",
   543  				"jobLocation": null,
   544  				"subdomain": "dsds",
   545  				"betaEnabled": false,
   546  				"expiryDate": null
   547  			},
   548  			"globalAccountGUID": "e63bd660-35f6-48d4-bf2a-8b77233b947e",
   549  			"entityId": "%s",
   550  			"entityType": "Subaccount",
   551  			"eventOrigin": "accounts-service",
   552  			"eventType": "Subaccount_Deletion"
   553  		}`,
   554  		`{
   555  			"id": 605716,
   556  			"actionTime": 1596367854558,
   557  			"creationTime": 1596367855057,
   558  			"details": {
   559  				"description": "Subaccount deleted.",
   560  				"guid": "%s",
   561  				"parentGuid": "261ba8b6-6b33-47e7-9558-3bccb237a920",
   562  				"displayName": "trial",
   563  				"subaccountDescription": null,
   564  				"region": "eu10-canary",
   565  				"jobLocation": null,
   566  				"subdomain": "31f4a136trial",
   567  				"betaEnabled": false,
   568  				"expiryDate": null
   569  			},
   570  			"globalAccountGUID": "261ba8b6-6b33-47e7-9558-3bccb237a920",
   571  			"entityId": "%s",
   572  			"entityType": "Subaccount",
   573  			"eventOrigin": "accounts-service",
   574  			"eventType": "Subaccount_Deletion"
   575  		}`,
   576  		`{
   577  			"id": 605715,
   578  			"actionTime": 1596367853478,
   579  			"creationTime": 1596367854068,
   580  			"details": {
   581  				"description": "Subaccount deleted.",
   582  				"guid": "%s",
   583  				"parentGuid": "261ba8b6-6b33-47e7-9558-3bccb237a920",
   584  				"displayName": "trial-aws2",
   585  				"subaccountDescription": null,
   586  				"region": "eu10-canary",
   587  				"jobLocation": null,
   588  				"subdomain": "jklkjlkjl",
   589  				"betaEnabled": false,
   590  				"expiryDate": null
   591  			},
   592  			"globalAccountGUID": "261ba8b6-6b33-47e7-9558-3bccb237a920",
   593  			"entityId": "%s",
   594  			"entityType": "Subaccount",
   595  			"eventOrigin": "accounts-service",
   596  			"eventType": "Subaccount_Deletion"
   597  		}`,
   598  		`{
   599  			"id": 605714,
   600  			"actionTime": 1596367853363,
   601  			"creationTime": 1596367854057,
   602  			"details": {
   603  				"description": "Subaccount deleted.",
   604  				"guid": "%s",
   605  				"parentGuid": "261ba8b6-6b33-47e7-9558-3bccb237a920",
   606  				"displayName": "trial-aws3",
   607  				"subaccountDescription": null,
   608  				"region": "eu10-canary",
   609  				"jobLocation": null,
   610  				"subdomain": "trial-aws3-canary-vered-s",
   611  				"betaEnabled": false,
   612  				"expiryDate": null
   613  			},
   614  			"globalAccountGUID": "261ba8b6-6b33-47e7-9558-3bccb237a920",
   615  			"entityId": "%s",
   616  			"entityType": "Subaccount",
   617  			"eventOrigin": "accounts-service",
   618  			"eventType": "Subaccount_Deletion"
   619  		}`,
   620  		`{
   621  			"id": 601724,
   622  			"actionTime": 1596184712873,
   623  			"creationTime": 1596184713273,
   624  			"details": {
   625  				"description": "Subaccount deleted.",
   626  				"guid": "%s",
   627  				"parentGuid": "6e0bbab7-8475-4616-8a62-969b9c5c4c40",
   628  				"displayName": "trial",
   629  				"subaccountDescription": null,
   630  				"region": "eu10-canary",
   631  				"jobLocation": null,
   632  				"subdomain": "718bd8bdtrial",
   633  				"betaEnabled": false,
   634  				"expiryDate": null
   635  			},
   636  			"globalAccountGUID": "6e0bbab7-8475-4616-8a62-969b9c5c4c40",
   637  			"entityId": "%s",
   638  			"entityType": "Subaccount",
   639  			"eventOrigin": "accounts-service",
   640  			"eventType": "Subaccount_Deletion"
   641  		}`,
   642  		`{
   643  			"id": 595710,
   644  			"actionTime": 1596027654527,
   645  			"creationTime": 1596027655094,
   646  			"details": {
   647  				"description": "Subaccount deleted.",
   648  				"guid": "%s",
   649  				"parentGuid": "66f583c4-2752-446a-89d0-c6b4270db5cf",
   650  				"displayName": "trial",
   651  				"subaccountDescription": null,
   652  				"region": "eu10-canary",
   653  				"jobLocation": null,
   654  				"subdomain": "835876dbtrial",
   655  				"betaEnabled": false,
   656  				"expiryDate": null
   657  			},
   658  			"globalAccountGUID": "66f583c4-2752-446a-89d0-c6b4270db5cf",
   659  			"entityId": "%s",
   660  			"entityType": "Subaccount",
   661  			"eventOrigin": "accounts-service",
   662  			"eventType": "Subaccount_Deletion"
   663  		}`,
   664  		`{
   665  			"id": 595707,
   666  			"actionTime": 1596027641653,
   667  			"creationTime": 1596027642279,
   668  			"details": {
   669  				"description": "Subaccount deleted.",
   670  				"guid": "%s",
   671  				"parentGuid": "66f583c4-2752-446a-89d0-c6b4270db5cf",
   672  				"displayName": "subaccount2",
   673  				"subaccountDescription": "string",
   674  				"region": "eu10-canary",
   675  				"jobLocation": null,
   676  				"subdomain": "835876dbtrialsa2",
   677  				"betaEnabled": false,
   678  				"expiryDate": null
   679  			},
   680  			"globalAccountGUID": "66f583c4-2752-446a-89d0-c6b4270db5cf",
   681  			"entityId": "%s",
   682  			"entityType": "Subaccount",
   683  			"eventOrigin": "accounts-service",
   684  			"eventType": "Subaccount_Deletion"
   685  		}`,
   686  		`{
   687  			"id": 594668,
   688  			"actionTime": 1596009648611,
   689  			"creationTime": 1596009649067,
   690  			"details": {
   691  				"description": "Subaccount deleted.",
   692  				"guid": "%s",
   693  				"parentGuid": "3dfea6f5-0183-49e6-b639-1da3c02d2916",
   694  				"displayName": "trial",
   695  				"subaccountDescription": null,
   696  				"region": "eu10-canary",
   697  				"jobLocation": null,
   698  				"subdomain": "fba37631trial",
   699  				"betaEnabled": false,
   700  				"expiryDate": null
   701  			},
   702  			"globalAccountGUID": "3dfea6f5-0183-49e6-b639-1da3c02d2916",
   703  			"entityId": "%s",
   704  			"entityType": "Subaccount",
   705  			"eventOrigin": "accounts-service",
   706  			"eventType": "Subaccount_Deletion"
   707  		}`,
   708  		`{
   709  			"id": 592381,
   710  			"actionTime": 1595946062732,
   711  			"creationTime": 1595946063076,
   712  			"details": {
   713  				"description": "Subaccount deleted.",
   714  				"guid": "%s",
   715  				"parentGuid": "6d0de353-d5ef-4400-830b-5519588cb538",
   716  				"displayName": "trial",
   717  				"subaccountDescription": null,
   718  				"region": "eu10-canary",
   719  				"jobLocation": null,
   720  				"subdomain": "a82684abtrial",
   721  				"betaEnabled": false,
   722  				"expiryDate": null
   723  			},
   724  			"globalAccountGUID": "6d0de353-d5ef-4400-830b-5519588cb538",
   725  			"entityId": "%s",
   726  			"entityType": "Subaccount",
   727  			"eventOrigin": "accounts-service",
   728  			"eventType": "Subaccount_Deletion"
   729  		}`,
   730  		`{
   731  			"id": 591018,
   732  			"actionTime": 1595926842908,
   733  			"creationTime": 1595926843309,
   734  			"details": {
   735  				"description": "Subaccount deleted.",
   736  				"guid": "%s",
   737  				"parentGuid": "673d8298-e639-4889-8f38-73c7a526f29e",
   738  				"displayName": "trial",
   739  				"subaccountDescription": null,
   740  				"region": "eu10-canary",
   741  				"jobLocation": null,
   742  				"subdomain": "578472fetrial",
   743  				"betaEnabled": false,
   744  				"expiryDate": null
   745  			},
   746  			"globalAccountGUID": "673d8298-e639-4889-8f38-73c7a526f29e",
   747  			"entityId": "%s",
   748  			"entityType": "Subaccount",
   749  			"eventOrigin": "accounts-service",
   750  			"eventType": "Subaccount_Deletion"
   751  		}`,
   752  		`{
   753  			"id": 584181,
   754  			"actionTime": 1595677554846,
   755  			"creationTime": 1595677555088,
   756  			"details": {
   757  				"description": "Subaccount deleted.",
   758  				"guid": "%s",
   759  				"parentGuid": "d1583185-55f5-4791-be33-4b7583edd27b",
   760  				"displayName": "trial",
   761  				"subaccountDescription": null,
   762  				"region": "eu10-canary",
   763  				"jobLocation": null,
   764  				"subdomain": "88082afatrial",
   765  				"betaEnabled": false,
   766  				"expiryDate": null
   767  			},
   768  			"globalAccountGUID": "d1583185-55f5-4791-be33-4b7583edd27b",
   769  			"entityId": "%s",
   770  			"entityType": "Subaccount",
   771  			"eventOrigin": "accounts-service",
   772  			"eventType": "Subaccount_Deletion"
   773  		}`,
   774  		`{
   775  			"id": 584180,
   776  			"actionTime": 1595677554755,
   777  			"creationTime": 1595677555077,
   778  			"details": {
   779  				"description": "Subaccount deleted.",
   780  				"guid": "%s",
   781  				"parentGuid": "9e680c4b-47e1-4498-b7d7-88f6ec2df1aa",
   782  				"displayName": "trial",
   783  				"subaccountDescription": null,
   784  				"region": "eu10-canary",
   785  				"jobLocation": null,
   786  				"subdomain": "b9c1c00dtrial",
   787  				"betaEnabled": false,
   788  				"expiryDate": null
   789  			},
   790  			"globalAccountGUID": "9e680c4b-47e1-4498-b7d7-88f6ec2df1aa",
   791  			"entityId": "%s",
   792  			"entityType": "Subaccount",
   793  			"eventOrigin": "accounts-service",
   794  			"eventType": "Subaccount_Deletion"
   795  		}`,
   796  		`{
   797  			"id": 584179,
   798  			"actionTime": 1595677554751,
   799  			"creationTime": 1595677555067,
   800  			"details": {
   801  				"description": "Subaccount deleted.",
   802  				"guid": "%s",
   803  				"parentGuid": "a8c21ef2-138f-4b0e-9a3f-3925b72c96a2",
   804  				"displayName": "trial",
   805  				"subaccountDescription": null,
   806  				"region": "eu10-canary",
   807  				"jobLocation": null,
   808  				"subdomain": "0397e6cetrial",
   809  				"betaEnabled": false,
   810  				"expiryDate": null
   811  			},
   812  			"globalAccountGUID": "a8c21ef2-138f-4b0e-9a3f-3925b72c96a2",
   813  			"entityId": "%s",
   814  			"entityType": "Subaccount",
   815  			"eventOrigin": "accounts-service",
   816  			"eventType": "Subaccount_Deletion"
   817  		}`,
   818  		`{
   819  			"id": 584175,
   820  			"actionTime": 1595677541448,
   821  			"creationTime": 1595677542081,
   822  			"details": {
   823  				"description": "Subaccount deleted.",
   824  				"guid": "%s",
   825  				"parentGuid": "d1583185-55f5-4791-be33-4b7583edd27b",
   826  				"displayName": "subaccount2",
   827  				"subaccountDescription": "string",
   828  				"region": "eu10-canary",
   829  				"jobLocation": null,
   830  				"subdomain": "88082afatrialsa2",
   831  				"betaEnabled": false,
   832  				"expiryDate": null
   833  			},
   834  			"globalAccountGUID": "d1583185-55f5-4791-be33-4b7583edd27b",
   835  			"entityId": "%s",
   836  			"entityType": "Subaccount",
   837  			"eventOrigin": "accounts-service",
   838  			"eventType": "Subaccount_Deletion"
   839  		}`,
   840  		`{
   841  			"id": 584120,
   842  			"actionTime": 1595676654819,
   843  			"creationTime": 1595676655062,
   844  			"details": {
   845  				"description": "Subaccount deleted.",
   846  				"guid": "%s",
   847  				"parentGuid": "1c9ddf1a-8ed9-4975-99f8-e7979fce14c4",
   848  				"displayName": "trial",
   849  				"subaccountDescription": null,
   850  				"region": "eu10-canary",
   851  				"jobLocation": null,
   852  				"subdomain": "a85af412trial",
   853  				"betaEnabled": false,
   854  				"expiryDate": null
   855  			},
   856  			"globalAccountGUID": "1c9ddf1a-8ed9-4975-99f8-e7979fce14c4",
   857  			"entityId": "%s",
   858  			"entityType": "Subaccount",
   859  			"eventOrigin": "accounts-service",
   860  			"eventType": "Subaccount_Deletion"
   861  		}`,
   862  	}
   863  )