@Test public void sqlPopulated() { ConnectionMetaData data = new ConnectionMetaData(); data.product = "product"; data.version = "version"; data.url = "url"; when(extractor.parse(anyObject())).thenReturn(data); Object connectionObject = ""; storage.populate(sqlStatementData, connectionObject); assertThat(storage.storage.size(), is(1L)); assertThat(storage.storage.getIfPresent(connectionObject), is(data)); verify(sqlStatementData, times(1)).setDatabaseProductName(data.product); verify(sqlStatementData, times(1)).setDatabaseProductVersion(data.version); verify(sqlStatementData, times(1)).setDatabaseUrl(data.url); storage.populate(sqlStatementData, connectionObject); assertThat(storage.storage.size(), is(1L)); assertThat(storage.storage.getIfPresent(connectionObject), is(data)); verify(sqlStatementData, times(2)).setDatabaseProductName(data.product); verify(sqlStatementData, times(2)).setDatabaseProductVersion(data.version); verify(sqlStatementData, times(2)).setDatabaseUrl(data.url); }
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);  }