I’m having an issue using data tables in the Spock framework, when I recompile, the data table doesn’t seem to load correctly and I have to restart the server to see correct changes. I’m using JRebel 6.4.4. I’ll try to post a simple case that reproduces the error, for it’s part of a huge project but it looks kind of like this:
def "different items and scalable by quantity"() {
setup:
SPProductPromotionModel promotionModel = importCampaign('/test-import/test-xml/campaign-br-item-threshold-free-gift.xml')
CartModel cart
expect: "Promotion should fire correct number of times"
promotionModel.setDifferentItems diffItems
promotionModel.setScalable scalable
modelService.save promotionModel
products.each { k,v ->
cart = addProductToCart(k, v)
}
cart.allPromotionResults.findAll {
it.certainty == 1.0F && !it.allPromotionActions.isEmpty()
}.size() == firedTimes
def matchingCertainty = cart.allPromotionResults.findAll {
it.certainty == pf
}.size()
matchingCertainty > 0 || (pf == 0F && matchingCertainty == 0)
where:
firedTimes | pf | diffItems | scalable | products
// diff + scalable
0 | 0.50F | true | true | ['101': 2]
0 | 0.50F | true | true | ['101': 2, '103': 1]
1 | 0.50F | true | true | ['101': 2, '102':1,'103': 1]
2 | 0.00F | true | true | ['101': 2, '102':2,'103': 1, '106': 1]
2 | 0.00F | true | true | ['101': 2, '102':2,'103': 2]
// more data...
//WHEN I UPDATE THE TABLE, it doesn't work, I have to restart JVM
}