Интеграционный тест с предложением 'in' в sql вызывает ошибку при индивидуальном запуске - PullRequest
0 голосов
/ 03 июля 2019

У меня есть интеграционные (h2, spock, grails-2.5.5) тесты, которые выполняются внутри sql (gorm).Этот тест работает нормально, когда все тесты выполняются вместе "grails test-app", но когда я запускаю его по отдельности, тест не пройден и выдает следующую ошибку:

count_subscriber_brands subscriber6_ on br2_.id=subscriber6_.brand_id left outer join account_subscriber brs3_ on subscriber6_.account_subscriber_id=brs3_.id left outer join account brs3_1_ on brs3_.id=brs3_1_.id left outer join product_subscriber_publish sp1_ on this_.id=sp1_.product_id where this_.gtin=? and ((sp1_.subscriber_id=? and sp1_.is_published=?) or (this_.status in (?, ?) and ((br2_.exclusive=? and brs3_.id=?) or br2_.exclusive is null or br2_.exclusive=?))) [22018-176]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
    at org.h2.message.DbException.get(DbException.java:167)
    at org.h2.value.Value.convertTo(Value.java:902)
    at org.h2.expression.ConditionIn.getValue(ConditionIn.java:57)
    at org.h2.expression.ConditionAndOr.getValue(ConditionAndOr.java:87)
    at org.h2.expression.ConditionAndOr.getValue(ConditionAndOr.java:110)
    at org.h2.expression.ConditionAndOr.getValue(ConditionAndOr.java:94)
    at org.h2.expression.Expression.getBooleanValue(Expression.java:179)
    at org.h2.command.dml.Select.queryFlat(Select.java:535)
    at org.h2.command.dml.Select.queryWithoutCache(Select.java:646)
    at org.h2.command.dml.Query.query(Query.java:323)
    at org.h2.command.dml.Query.query(Query.java:291)
    at org.h2.command.dml.Query.query(Query.java:37)
    at org.h2.command.CommandContainer.query(CommandContainer.java:91)
    at org.h2.command.Command.executeQuery(Command.java:197)
    at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:109)
    ... 7 more
Caused by: java.lang.NumberFormatException: For input string: "INACTIVATED"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:580)
    at java.lang.Integer.parseInt(Integer.java:615)
    at org.h2.value.Value.convertTo(Value.java:852)
    ... 20 more

Предложение gorm содержит 'in' ('status ', [FINE, WORK, INACTIVATED])

Когда я запускаюсь индивидуально, тесты тоже отлично работают

...