Skip to content

Commit 2e35155

Browse files
Adjust tests to reflect non snake case of non existant columns
1 parent e625333 commit 2e35155

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/test/java/org/javawebstack/orm/test/querybuilding/OrderByClauseTest.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.javawebstack.orm.query.Query;
55
import org.javawebstack.orm.test.exception.SectionIndexOutOfBoundException;
66
import org.javawebstack.orm.test.shared.models.Datatype;
7+
import org.javawebstack.orm.test.shared.models.columnnames.OverwrittenColumnName;
78
import org.javawebstack.orm.test.shared.verification.QueryVerification;
89
import org.junit.jupiter.api.Test;
910
import java.util.*;
@@ -24,7 +25,9 @@ void testOneExistingColumnDefaultOrderBy() {
2425
void testOneNonExistingColumnDefaultOrderBy() {
2526
Query<Datatype> query = setUpModel(Datatype.class).query()
2627
.order("doesNotExist");
27-
new QueryVerification(query).assertSectionEquals("ORDER BY", "`does_not_exist`");
28+
29+
// Not in snake case as it is not in the mapping
30+
new QueryVerification(query).assertSectionEquals("ORDER BY", "`doesNotExist`");
2831
}
2932

3033
@Test
@@ -38,7 +41,9 @@ void testOneExistingColumnASCOrderBy() {
3841
void testOneNonExistingColumnASCOrderBy() {
3942
Query<Datatype> query = setUpModel(Datatype.class).query()
4043
.order("doesNotExist", false);
41-
new QueryVerification(query).assertSectionEquals("ORDER BY", "`does_not_exist`");
44+
45+
// Not in snake case as it is not in the mapping
46+
new QueryVerification(query).assertSectionEquals("ORDER BY", "`doesNotExist`");
4247
}
4348

4449
@Test
@@ -52,7 +57,8 @@ void testOneExistingColumnDESCOrderBy() {
5257
void testOneNonExistingColumnDESCOrderBy() {
5358
Query<Datatype> query = setUpModel(Datatype.class).query()
5459
.order("doesNotExist", true);
55-
new QueryVerification(query).assertSectionEquals("ORDER BY", "`does_not_exist` DESC");
60+
// Not in snake case as it is not in the mapping
61+
new QueryVerification(query).assertSectionEquals("ORDER BY", "`doesNotExist` DESC");
5662
}
5763

5864
@Test

0 commit comments

Comments
 (0)