executeUpdate('update query is not working ')

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

executeUpdate('update query is not working ')

Amit Shah
I m new to grails.I am willing to test serviceĀ  , and part of test.
the key problem is that executeUpdate Query is not working. Why ??? Suggest me. Thanks in advance

def merchantTier 
void setUp
()
{
merchantTier = new MerchantTier(
startTier: tier,
endTier: tier,
value: 2.02).save(flush: true)
}


void "for given merchantTierId update merchantTier"(){
setup:
params = [id:merchantTier.id,tierVal:2]

when:
testData = updateIndividualSuperResellerTier(params)

then:"return data"
merchantTier.value==params.tierVal
}


def updateIndividualSuperResellerTier(params) {
def merchantTierVal = 0
if (params.tierVal) {
merchantTierVal = params.tierVal.toDouble()
}
def merchantTier = MerchantTier.get(params.id.toLong())
def updateMerchantTier = MerchantTier.executeUpdate('update MerchantTier mt set mt.value=:mrValue where mt.id=:mtId', [mrValue: merchantTierVal, mtId: params.id.toLong()])
}

the key problem is that executeUpdate Query is not working. Why ??? Suggest me. Thanks in advance

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Loading...