-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to use the latest system commands
- Loading branch information
amckenzie
committed
Jun 25, 2019
1 parent
dd603a9
commit f8f5d89
Showing
5 changed files
with
65 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
.../test/java/uk/gov/justice/services/example/cakeshop/it/helpers/ProcessedEventCounter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package uk.gov.justice.services.example.cakeshop.it.helpers; | ||
|
||
import java.sql.Connection; | ||
import java.sql.PreparedStatement; | ||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
|
||
import javax.sql.DataSource; | ||
|
||
public class ProcessedEventCounter { | ||
|
||
private final DataSource viewStoreDataSource; | ||
|
||
public ProcessedEventCounter(final DataSource viewStoreDataSource) { | ||
this.viewStoreDataSource = viewStoreDataSource; | ||
} | ||
|
||
|
||
public int countProcessedEvents() { | ||
|
||
final String sql = "SELECT COUNT (*) FROM processed_event"; | ||
|
||
try(final Connection connection = viewStoreDataSource.getConnection(); | ||
final PreparedStatement preparedStatement = connection.prepareStatement(sql); | ||
final ResultSet resultSet = preparedStatement.executeQuery()) { | ||
|
||
resultSet.next(); | ||
|
||
return resultSet.getInt(1); | ||
} catch (final SQLException e) { | ||
throw new RuntimeException("Failed to run query '" + sql + "' against the view store", e); | ||
} | ||
} | ||
} |
48 changes: 0 additions & 48 deletions
48
.../test/java/uk/gov/justice/services/example/cakeshop/it/helpers/PublishedEventCounter.java
This file was deleted.
Oops, something went wrong.
88 changes: 0 additions & 88 deletions
88
...c/test/java/uk/gov/justice/services/example/cakeshop/it/helpers/RecipeTableInspector.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters