Skip to content

Commit

Permalink
Fixed name of new spectator table
Browse files Browse the repository at this point in the history
Updated PostgresqlEntityTest for spectator storage
  • Loading branch information
tedyoung committed Oct 2, 2023
1 parent 77ae597 commit 2456018
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE TABLE declined_member
CREATE TABLE spectator_member
(
member_id BIGINT NOT NULL,
ensemble_id BIGINT NOT NULL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import static org.assertj.core.api.Assertions.*;

//@SpringBootTest
@DataJdbcTest(properties = {
"spring.test.database.replace=NONE",
"spring.datasource.url=jdbc:tc:postgresql:14:///springboot"
Expand All @@ -36,6 +35,8 @@ public void ensembleEntityStoredViaJdbcIsRetrievedWithMembers() throws Exception
original.acceptedBy(MemberId.of(5L));
original.declinedBy(MemberId.of(73L));
original.declinedBy(MemberId.of(79L));
original.joinAsSpectator(MemberId.of(97L));
original.joinAsSpectator(MemberId.of(101L));
EnsembleDbo originalEntity = EnsembleDbo.from(original);

EnsembleDbo savedEntity = ensembleJdbcRepository.save(originalEntity);
Expand All @@ -57,6 +58,11 @@ public void ensembleEntityStoredViaJdbcIsRetrievedWithMembers() throws Exception
.extracting(DeclinedMember::asMemberId)
.extracting(MemberId::id)
.containsOnly(73L, 79L);

assertThat(retrievedEntity.get().getSpectatorMembers())
.extracting(SpectatorMember::asMemberId)
.extracting(MemberId::id)
.containsOnly(97L, 101L);
}

@Test
Expand Down

0 comments on commit 2456018

Please sign in to comment.