Skip to content

Commit e25d340

Browse files
author
Igor Polevoy
committed
#405 Implement minimal support for composite primary keys
1 parent 0d7db2b commit e25d340

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

activejdbc/src/test/java/org/javalite/activejdbc/CompositePkTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void shouldGenerateNoSuchElementFromBlankUpdate() {
4242
@Test
4343
public void shouldGenerateValidSQL() {
4444
Developer dev = new Developer();
45-
dev.set("first_name", "Johnny", "last_name", "Cash", "email", "j.cash@spam.org", "address", "inserted");
45+
dev.set("first_name", "Johnny", "last_name", "Cash", "email", "j.cash@spam.org", "address", "123 Pine St");
4646
the(Base.exec(dev.toInsert())).shouldBeEqual(1);
4747
dev.set("address", "updated");
4848
the(Base.exec(dev.toUpdate())).shouldBeEqual(1);
@@ -60,15 +60,15 @@ public void shouldGenerateValidSQL() {
6060

6161
@Test
6262
public void shouldReturnNullWithWrongPKs() {
63-
Developer.createIt("first_name", "Johnny", "last_name", "Cash", "email", "j.cash@spam.org", "address", "inserted");
63+
Developer.createIt("first_name", "Johnny", "last_name", "Cash", "email", "j.cash@spam.org", "address", "123 Pine St");
6464
the(Developer.findByCompositeKeys("Johnny", "Casher", "j.cash@spam.org")).shouldBeNull();
6565
the(Developer.findByCompositeKeys("John", "Cash", "j.cash@spam.org")).shouldBeNull();
6666
the(Developer.findByCompositeKeys("Johnny", "Cash", "j.cash@spam.com")).shouldBeNull();
6767
}
6868

6969
@Test
7070
public void shouldDeleteByPK() {
71-
Developer.createIt("first_name", "Johnny", "last_name", "Cash", "email", "j.cash@spam.org", "address", "inserted");
71+
Developer.createIt("first_name", "Johnny", "last_name", "Cash", "email", "j.cash@spam.org", "address", "123 Pine St");
7272
Developer dev = Developer.findByCompositeKeys("Johnny", "Cash", "j.cash@spam.org");
7373
the(dev).shouldNotBeNull();
7474
the(Developer.count()).shouldBeEqual(1);
@@ -81,15 +81,15 @@ public void shouldDeleteByPK() {
8181
public void shouldBeNew() {
8282

8383
Developer dev = new Developer();
84-
dev.set("first_name", "Johnny", "last_name", "Cash", "email", "j.cash@spam.org", "address", "inserted");
84+
dev.set("first_name", "Johnny", "last_name", "Cash", "email", "j.cash@spam.org", "address", "123 Pine St");
8585
the(dev.isNew()).shouldBeTrue();
8686

87-
Developer.createIt("first_name", "Johnny", "last_name", "Cash", "email", "j.cash@spam.org", "address", "inserted");
87+
Developer.createIt("first_name", "Johnny", "last_name", "Cash", "email", "j.cash@spam.org", "address", "123 Pine St");
8888
dev = Developer.findByCompositeKeys("Johnny", "Cash", "j.cash@spam.org");
8989
the(dev).shouldNotBeNull();
9090
the(dev.isNew()).shouldBeFalse();
9191

92-
dev = Developer.createIt("first_name", "Johnny", "last_name", "Cash2", "email", "j.cash@spam.org", "address", "inserted");
92+
dev = Developer.createIt("first_name", "Johnny", "last_name", "Cash2", "email", "j.cash@spam.org", "address", "123 Pine St");
9393
the(dev.isNew()).shouldBeFalse();
9494
}
9595
}

0 commit comments

Comments
 (0)