From 5b9c1d229f103cca10f9ac24ce392e7b90dd25ad Mon Sep 17 00:00:00 2001 From: michaelborn Date: Tue, 11 Jan 2022 14:55:13 +0000 Subject: [PATCH] Apply cfformat changes --- modules/cbelasticsearch/models/Task.cfc | 2 +- tests/specs/unit/TaskTest.cfc | 28 +++++++++---------------- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/modules/cbelasticsearch/models/Task.cfc b/modules/cbelasticsearch/models/Task.cfc index 8cf4faa..ab4003a 100644 --- a/modules/cbelasticsearch/models/Task.cfc +++ b/modules/cbelasticsearch/models/Task.cfc @@ -35,7 +35,7 @@ component accessors="true" { public function populate( struct properties ){ if ( arguments.keyExists( "properties" ) ) { - if ( structKeyExists( arguments.properties, "error" ) ){ + if ( structKeyExists( arguments.properties, "error" ) ) { setError( arguments.properties.error ); } if ( structKeyExists( arguments.properties, "task" ) ) { diff --git a/tests/specs/unit/TaskTest.cfc b/tests/specs/unit/TaskTest.cfc index a57d26b..a0cf2fd 100644 --- a/tests/specs/unit/TaskTest.cfc +++ b/tests/specs/unit/TaskTest.cfc @@ -62,30 +62,22 @@ component extends="coldbox.system.testing.BaseTestCase" { "cancellable" : true }, "error" : { - "position": { - "offset": 33, - "start": 16, - "end": 64 + "position" : { "offset" : 33, "start" : 16, "end" : 64 }, + "script" : " for ( test in ctx._source ){ ...", + "reason" : "runtime error", + "type" : "script_exception", + "lang" : "painless", + "caused_by" : { + "reason" : "Cannot iterate over [java.util.HashMap]", + "type" : "illegal_argument_exception" }, - "script": " for ( test in ctx._source ){ ...", - "reason": "runtime error", - "type": "script_exception", - "lang": "painless", - "caused_by": { - "reason": "Cannot iterate over [java.util.HashMap]", - "type": "illegal_argument_exception" - }, - "script_stack": [ - "for ( case in ctx._source ){ ", - " ^---- HERE" - ] + "script_stack" : [ "for ( case in ctx._source ){ ", " ^---- HERE" ] } }; variables.model.populate( testTask ); expect( variables.model.getCompleted() ).toBe( testTask.completed ); - expect( variables.model.getError() ).toBeTypeOf( "struct" ) - .toHaveKey( "reason" ); + expect( variables.model.getError() ).toBeTypeOf( "struct" ).toHaveKey( "reason" ); } ); } ); }