Skip to content

Commit 1449f2f

Browse files
committed
Fix
1 parent 1df05d0 commit 1449f2f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

driver-core/src/test/functional/com/mongodb/client/model/expressions/ControlExpressionsFunctionalTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,14 @@ public void switchInferenceTest() {
109109
public void switchTypesTest() {
110110
Function<Expression, StringExpression> label = expr -> expr.switchOn(on -> on
111111
.isBoolean(v -> v.asString().concat(of(" - bool")))
112+
// integer should be checked before string
113+
.isInteger(v -> v.asString().concat(of(" - integer")))
114+
.isNumber(v -> v.asString().concat(of(" - number")))
112115
.isString(v -> v.asString().concat(of(" - string")))
113116
.isDate(v -> v.asString().concat(of(" - date")))
114117
.isArray((ArrayExpression<IntegerExpression> v) -> v.sum(a -> a).asString().concat(of(" - array")))
115118
.isDocument(v -> v.getString("_id").concat(of(" - document")))
116119
.isNull(v -> of("null - null"))
117-
.isInteger(v -> v.asString().concat(of(" - integer")))
118-
.isNumber(v -> v.asString().concat(of(" - number")))
119120
.defaults(v -> of("default"))
120121
).toLower();
121122
assertExpression("true - bool", of(true).passTo(label));

0 commit comments

Comments
 (0)