Skip to content

Commit

Permalink
Apply cfformat changes
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelborn authored and actions-user committed Jan 11, 2022
1 parent aa4fcc2 commit 5b9c1d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion modules/cbelasticsearch/models/Task.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -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" ) ) {
Expand Down
28 changes: 10 additions & 18 deletions tests/specs/unit/TaskTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
} );
} );
}
Expand Down

0 comments on commit 5b9c1d2

Please sign in to comment.