TableUtils { public static void ensureTableExists(final AccumuloStore store) throws StoreException { final String tableName = store.getTableName(); if (null == tableName) { throw new AccumuloRuntimeException("Table name is required."); } final Connector connector = store.getConnection(); if (connector.tableOperations().exists(tableName)) { validateTable(store, tableName, connector); } else { try { TableUtils.createTable(store); } catch (final TableExistsException e) { } } } private  TableUtils(); static void ensureTableExists(final AccumuloStore store); static synchronized void createTable(final AccumuloStore store); static void setLocalityGroups(final AccumuloStore store); static BatchWriter createBatchWriter(final AccumuloStore store); static Connector getConnector(final String instanceName, final String zookeepers, final String userName,
                                         final String password); static Authorizations getCurrentAuthorizations(final Connector connection); static final String COLUMN_FAMILIES_OPTION; }
@Test public void shouldThrowExceptionIfTableNameIsNotSpecified() throws StoreException { final Schema schema = new Schema.Builder() .type("int", Integer.class) .type("string", String.class) .type("boolean", Boolean.class) .edge("EDGE", new SchemaEdgeDefinition.Builder() .source("string") .destination("string") .directed("boolean") .build()) .build(); final AccumuloProperties properties = new AccumuloProperties(); properties.setStoreClass(PROPERTIES.getStoreClass()); properties.setZookeepers(PROPERTIES.getZookeepers()); final AccumuloStore store = new AccumuloStore(); assertThrows(IllegalArgumentException.class, () -> store.initialise(null, schema, properties)); assertThrows(AccumuloRuntimeException.class, () -> TableUtils.ensureTableExists(store)); }