func writeJSONToService(service baseftrwapp.Service, pathToJSONFile string, assert *assert.Assertions) {
	f, err := os.Open(pathToJSONFile)
	assert.NoError(err)
	dec := json.NewDecoder(f)
	inst, _, errr := service.DecodeJSON(dec)
	assert.NoError(errr)
	errrr := service.Write(inst)
	assert.NoError(errrr)
}
Esempio n. 2
0
func makeCheck(service baseftrwapp.Service, cr neoutils.CypherRunner) v1a.Check {
	return v1a.Check{
		BusinessImpact:   "Cannot read/write subjects via this writer",
		Name:             "Check connectivity to Neo4j - neoUrl is a parameter in hieradata for this service",
		PanicGuide:       "TODO - write panic guide",
		Severity:         1,
		TechnicalSummary: fmt.Sprintf("Cannot connect to Neo4j instance %s with at least one subject loaded in it", cr),
		Checker:          func() (string, error) { return "", service.Check() },
	}
}
Esempio n. 3
0
func makeCheck(service baseftrwapp.Service, cr neoutils.CypherRunner) v1a.Check {
	return v1a.Check{
		BusinessImpact:   "Cannot read/write brands via this writer",
		Name:             "Check connectivity to Neo4j - neoUrl is a parameter in hieradata for this service",
		PanicGuide:       "https://sites.google.com/a/ft.com/ft-technology-service-transition/home/run-book-library/brand-rw-neo4j",
		Severity:         1,
		TechnicalSummary: fmt.Sprintf("Cannot connect to Neo4j instance %s with at least one brand loaded in it", cr),
		Checker:          func() (string, error) { return "", service.Check() },
	}
}
func deleteFinancialInstrumentViaService(assert *assert.Assertions, financialInstrument baseftrwapp.Service, uuid string) {
	_, err := financialInstrument.Delete(uuid)
	assert.NoError(err)
}
func deleteAllViaService(assert *assert.Assertions, peopleRW baseftrwapp.Service, organisationRW baseftrwapp.Service, membershipsRW baseftrwapp.Service, rolesRW baseftrwapp.Service) {
	peopleRW.Delete("868c3c17-611c-4943-9499-600ccded71f3")
	peopleRW.Delete("fa2ae871-ef77-49c8-a030-8d90eae6cf18")
	peopleRW.Delete("84cec0e1-a866-47bd-9444-d74873b69786")
	peopleRW.Delete("bdacd96e-d2f4-429f-bb61-462e40448409")

	organisationRW.Delete("f21a5cc0-d326-4e62-b84a-d840c2209fee")
	organisationRW.Delete("3e844449-b27f-40d4-b696-2ce9b6137133")
	organisationRW.Delete("f9694ba7-eab0-4ce0-8e01-ff64bccb813c")

	membershipsRW.Delete("6b278d36-5b30-46a3-b036-55902a9d31ac")
	membershipsRW.Delete("668c103f-d8dc-4938-9324-9c60de726705")
	membershipsRW.Delete("c739b972-f41d-43d2-b8d9-5848c92e17f6")
	membershipsRW.Delete("177de04f-c09a-4d66-ab55-bb68496c9c28")
	membershipsRW.Delete("9c50e77a-de8a-4f8c-b1dd-09c7730e2c70")

	rolesRW.Delete("ff9e35f2-63e4-487a-87a4-d82535e047de")
	rolesRW.Delete("c7063a20-5ca5-4f7a-8a96-47e946b5739e")
	rolesRW.Delete("d8bbba91-8a87-4dee-bd1a-f79e8139e5c9")
	rolesRW.Delete("5fcfec9c-8ff0-4ee2-9e91-f270492d636c")
}
func deleteOrgViaService(assert *assert.Assertions, organisationRW baseftrwapp.Service, uuid string) {
	organisationRW.Delete(uuid)
}