@Override
public void before() throws Exception {
super.before();
user = getUserRepository().findOrAddUser("base-junit", "Base Junit", "base-junit@visallo.com", "password");
User systemUser = getUserRepository().getSystemUser();
Authorizations authorizations = getAuthorizationRepository().getGraphAuthorizations(systemUser);
thingConcept = getOntologyRepository().getEntityConcept(PUBLIC);
List<Concept> things = Collections.singletonList(thingConcept);
Relationship hasEntityRel = getOntologyRepository().getOrCreateRelationshipType(null, things, things, "has-entity-iri", true, systemUser, PUBLIC);
hasEntityRel.addIntent("entityHasImage", user, authorizations);
getOntologyRepository().getOrCreateConcept(thingConcept, JUNIT_CONCEPT_TYPE, "Junit Concept", null, systemUser, PUBLIC);
getOntologyRepository().getOrCreateRelationshipType(null, things, things, JUNIT_EDGE_LABEL, true, systemUser, PUBLIC);
OntologyPropertyDefinition propertyDefinition = new OntologyPropertyDefinition(things, JUNIT_PROPERTY_NAME, "Junit Property", PropertyType.STRING);
propertyDefinition.setTextIndexHints(Collections.singleton(TextIndexHint.EXACT_MATCH));
propertyDefinition.setUserVisible(true);
getOntologyRepository().getOrCreateProperty(propertyDefinition, systemUser, PUBLIC);
getOntologyRepository().clearCache();
workspace = getWorkspaceRepository().add("ws1", "workspace 1", user);
workspaceAuthorizations = getAuthorizationRepository().getGraphAuthorizations(user, workspace.getWorkspaceId());
}