Skip to content

Commit

Permalink
remove sameValid_at test
Browse files Browse the repository at this point in the history
  • Loading branch information
pranav-super committed Oct 21, 2024
1 parent 189e895 commit c390685
Showing 1 changed file with 0 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1408,45 +1408,6 @@ void rule4() throws SQLException {
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class ConstraintTests {

/**
* Generally, no two sources in a derivation group, regardless of a lack of overlap, can have the same valid_at. We
* demonstrate this with sparse sources. In this test, we don't even require events to demonstrate this behavior.
*/
@Test
void sameValid_at() throws SQLException {
// construct the sources
ExternalSource a = new ExternalSource(
"A",
SOURCE_TYPE,
DERIVATION_GROUP,
"2024-01-01T00:00:00Z",
"2024-01-01T03:00:00Z",
"2024-01-01T04:00:00Z",
CREATED_AT);
ExternalSource b = new ExternalSource(
"B",
SOURCE_TYPE,
DERIVATION_GROUP,
"2024-01-01T00:00:00Z",
"2024-01-01T01:00:00Z",
"2024-01-01T02:00:00Z",
CREATED_AT);

// create types and first source
insertExternalSourceType(SOURCE_TYPE);

insertDerivationGroup(DERIVATION_GROUP, SOURCE_TYPE);

insertExternalSource(a);

// second source should fail
final SQLException ex = assertThrows(PSQLException.class, () -> insertExternalSource(b));
if (!ex.getSQLState().equals("23505")
&& !ex.getMessage().contains("duplicate key value violates unique constraint \"dg_unique_valid_at\"")) {
throw ex;
}
}

/**
* A given source can have two (or more) events occurring at the same time, with all fields except the keys
* (see noDuplicateEventsInSameSource). This test demonstrates that behavior without error.
Expand Down

0 comments on commit c390685

Please sign in to comment.