EncryptTable { public String getLogicColumn(final String cipherColumn) { for (Entry<String, EncryptColumn> entry : columns.entrySet()) { if (entry.getValue().getCipherColumn().equals(cipherColumn)) { return entry.getKey(); } } throw new ShardingSphereException("Can not find logic column by %s.", cipherColumn); } EncryptTable(final EncryptTableRuleConfiguration config); Optional<String> findEncryptorName(final String logicColumn); Collection<String> getLogicColumns(); String getLogicColumn(final String cipherColumn); boolean isCipherColumn(final String columnName); String getCipherColumn(final String logicColumn); Collection<String> getAssistedQueryColumns(); Optional<String> findAssistedQueryColumn(final String logicColumn); Collection<String> getPlainColumns(); Optional<String> findPlainColumn(final String logicColumn); Map<String, String> getLogicAndCipherColumns();  }
@Test public void assertGetLogicColumn() { assertNotNull(encryptTable.getLogicColumn("cipherColumn")); }
@Test(expected = ShardingSphereException.class) public void assertGetLogicColumnWhenNotFind() { encryptTable.getLogicColumn("invalidColumn"); }