MongoDBClient { public static String getDbName(String companyName, String projectName) { String result = companyName + DB_NAME_SEPARATOR + projectName; return StringUtils.substring(result, 0, MAX_DB_NAME_LENGTH); }  MongoClient getMongoClient(); @Activate void activate(MongoDBClientConf config); @Deactivate void deactivate(); Collection<String> getCompanies(); @Deprecated DB getDB(String dbName); @Deprecated DB getDB(String dbName, Boolean autoCreate); MongoDatabase getDatabase(String dbName); MongoDatabase getDatabase(String dbName, Boolean autoCreate); Collection<String> getAetsDBNames(); boolean hasCollection(String dbName, String collectionName); static String getDbName(String companyName, String projectName); static String getCompanyNameFromDbName(String dbName); static String getProjectNameFromDbName(String dbName); static final String DB_NAME_SEPARATOR; }
@Test public void getDbName_expectUnderlineSeparatedName() throws Exception { final String dbName = MongoDBClient.getDbName("company", "project"); assertThat(dbName, is("company_project")); }