111213141516171819
OrganizationRepository organizationRepository; @Test @Rollback(false) public void createDefaultOrganization() { Organization organization = new Organization("fly"); organization.setInn("111"); organizationRepository.save(organization); }
1516171819202122
public Organization getRootOrganization() { if (repository.count() > 0) { return repository.findAll().iterator().next(); } Organization organization = new Organization("ЦЗК"); return repository.save(organization); }