ifs-data-layer/ifs-data-service/src/test/java/org/innovateuk/ifs/testutil/DatabaseTestHelper.java
/**
     * Assert that no database changes occur during the running of the given action
     */
Assert that no database changes occur during the running of the given action
Assert that no database changes occur during the running of the given action
public <T> T assertingNoDatabaseChangesOccur(Supplier<T> action) {
        try {
            String startingContent = getDatabaseContents();
            try {
                return action.get();
            } finally {
                String endingContent = getDatabaseContents();
                assertThat(startingContent).isEqualTo(endingContent);
            }
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
public < T > T assertingNoDatabaseChangesOccur ( Supplier < T > action ) { try { String startingContent = getDatabaseContents ( ) ; try { return action . get ( ) ; } finally { String endingContent = getDatabaseContents ( ) ; assertThat ( startingContent ) . isEqualTo ( endingContent ) ; } } catch ( SQLException e ) { throw new RuntimeException ( e ) ; } }
Assert that no database changes occur during the running of the given action
Assert that no database changes occur during the running of the given action