@Test public void shouldInsertTenant() { TenantRecord tenantRecord = createTestTenantRecord(); tenantDA.insertTenant(tenantRecord); Mockito.verify(mockRepository).create(Mockito.eq("tenant"), Mockito.argThat(new IsCorrectBody(tenantRecord))); }
@Override public void insertTenant(TenantRecord tenant) { if (entityRepository.findOne(TENANT_COLLECTION, new NeutralQuery(new NeutralCriteria(TENANT_ID, "=", tenant.getTenantId()))) == null) { entityRepository.create(TENANT_COLLECTION, getTenantBody(tenant)); } }
TenantMongoDA implements TenantDA { @Override public void insertTenant(TenantRecord tenant) { if (entityRepository.findOne(TENANT_COLLECTION, new NeutralQuery(new NeutralCriteria(TENANT_ID, "=", tenant.getTenantId()))) == null) { entityRepository.create(TENANT_COLLECTION, getTenantBody(tenant)); } } }
TenantMongoDA implements TenantDA { @Override public void insertTenant(TenantRecord tenant) { if (entityRepository.findOne(TENANT_COLLECTION, new NeutralQuery(new NeutralCriteria(TENANT_ID, "=", tenant.getTenantId()))) == null) { entityRepository.create(TENANT_COLLECTION, getTenantBody(tenant)); } }  }
TenantMongoDA implements TenantDA { @Override public void insertTenant(TenantRecord tenant) { if (entityRepository.findOne(TENANT_COLLECTION, new NeutralQuery(new NeutralCriteria(TENANT_ID, "=", tenant.getTenantId()))) == null) { entityRepository.create(TENANT_COLLECTION, getTenantBody(tenant)); } }  @Override List<String> getLzPaths(); @Override String getTenantId(String lzPath); @Override void insertTenant(TenantRecord tenant); @Override @SuppressWarnings("unchecked") String getTenantEdOrg(String lzPath); Repository<Entity> getEntityRepository(); void setEntityRepository(Repository<Entity> entityRepository); @SuppressWarnings("unchecked") @Override Map<String, List<String>> getPreloadFiles(String ingestionServer); @Override boolean tenantDbIsReady(String tenantId); @Override void setTenantReadyFlag(String tenantId); @Override void unsetTenantReadyFlag(String tenantId); @Override boolean updateAndAquireOnboardingLock(String tenantId); @Override void removeInvalidTenant(String lzPath); @Override Map<String, List<String>> getPreloadFiles(); @Override List<String> getAllTenantDbs(); }
TenantMongoDA implements TenantDA { @Override public void insertTenant(TenantRecord tenant) { if (entityRepository.findOne(TENANT_COLLECTION, new NeutralQuery(new NeutralCriteria(TENANT_ID, "=", tenant.getTenantId()))) == null) { entityRepository.create(TENANT_COLLECTION, getTenantBody(tenant)); } }  @Override List<String> getLzPaths(); @Override String getTenantId(String lzPath); @Override void insertTenant(TenantRecord tenant); @Override @SuppressWarnings("unchecked") String getTenantEdOrg(String lzPath); Repository<Entity> getEntityRepository(); void setEntityRepository(Repository<Entity> entityRepository); @SuppressWarnings("unchecked") @Override Map<String, List<String>> getPreloadFiles(String ingestionServer); @Override boolean tenantDbIsReady(String tenantId); @Override void setTenantReadyFlag(String tenantId); @Override void unsetTenantReadyFlag(String tenantId); @Override boolean updateAndAquireOnboardingLock(String tenantId); @Override void removeInvalidTenant(String lzPath); @Override Map<String, List<String>> getPreloadFiles(); @Override List<String> getAllTenantDbs(); static final String TENANT_ID; static final String DB_NAME; static final String INGESTION_SERVER; static final String PATH; static final String LANDING_ZONE; static final String PRELOAD_DATA; static final String PRELOAD_STATUS; static final String PRELOAD_FILES; static final String TENANT_COLLECTION; static final String TENANT_TYPE; static final String EDUCATION_ORGANIZATION; static final String DESC; static final String ALL_STATUS_FIELDS; static final String STATUS_FIELD; }