@Test public void extractorReturnsNull() { Object connectionObject = ""; when(extractor.parse(connectionObject)).thenReturn(null); storage.populate(sqlStatementData, connectionObject); assertThat(storage.storage.size(), is(1L)); storage.populate(sqlStatementData, connectionObject); assertThat(storage.storage.size(), is(1L)); verifyZeroInteractions(sqlStatementData); }
public void populate(SqlStatementData sqlData, Object connection) { ConnectionMetaData connectionMetaData = get(connection); if ((null != connectionMetaData) && (EMPTY != connectionMetaData)) { sqlData.setDatabaseProductName(connectionMetaData.product); sqlData.setDatabaseProductVersion(connectionMetaData.version); sqlData.setDatabaseUrl(connectionMetaData.url); } }
ConnectionMetaDataStorage { public void populate(SqlStatementData sqlData, Object connection) { ConnectionMetaData connectionMetaData = get(connection); if ((null != connectionMetaData) && (EMPTY != connectionMetaData)) { sqlData.setDatabaseProductName(connectionMetaData.product); sqlData.setDatabaseProductVersion(connectionMetaData.version); sqlData.setDatabaseUrl(connectionMetaData.url); } } }
ConnectionMetaDataStorage { public void populate(SqlStatementData sqlData, Object connection) { ConnectionMetaData connectionMetaData = get(connection); if ((null != connectionMetaData) && (EMPTY != connectionMetaData)) { sqlData.setDatabaseProductName(connectionMetaData.product); sqlData.setDatabaseProductVersion(connectionMetaData.version); sqlData.setDatabaseUrl(connectionMetaData.url); } }  }
ConnectionMetaDataStorage { public void populate(SqlStatementData sqlData, Object connection) { ConnectionMetaData connectionMetaData = get(connection); if ((null != connectionMetaData) && (EMPTY != connectionMetaData)) { sqlData.setDatabaseProductName(connectionMetaData.product); sqlData.setDatabaseProductVersion(connectionMetaData.version); sqlData.setDatabaseUrl(connectionMetaData.url); } }  void populate(SqlStatementData sqlData, Object connection); }
ConnectionMetaDataStorage { public void populate(SqlStatementData sqlData, Object connection) { ConnectionMetaData connectionMetaData = get(connection); if ((null != connectionMetaData) && (EMPTY != connectionMetaData)) { sqlData.setDatabaseProductName(connectionMetaData.product); sqlData.setDatabaseProductVersion(connectionMetaData.version); sqlData.setDatabaseUrl(connectionMetaData.url); } }  void populate(SqlStatementData sqlData, Object connection);  }