@@ -25,15 +25,15 @@ fun getMap(map : Map<*,*>, key : String) : Map<*,*>{
2525fun  <T > Map <* , * >.extract (path :  String ) : T  {
2626    val  tokens =  path.trim().split(' /'  ).filter(String ::isNotBlank)
2727    try  {
28-         return  tokens.fold(this  as  Any? ,  { workingMap, token -> 
28+         return  tokens.fold(this  as  Any? )  { workingMap, token -> 
2929            if (token.contains(' ['  )){
3030                val  list =  (workingMap as  Map <* ,* >)[token.substringBefore(' ['  )]
31-                 val  index =  token[ token.indexOf(' ['  )+ 1 ].toString( ).toInt()
31+                 val  index =  token.substring( token.indexOf(' ['  )+ 1 , token.length  - 1 ).toInt()
3232                (list as  List <* >)[index]
3333            } else  {
3434                (workingMap as  Map <* ,* >)[token]
3535            }
36-         })  as  T 
36+         } as  T 
3737    } catch  (e :  Exception ){
3838        throw  IllegalArgumentException (" Path: $path  does not exist in map: ${this } "  , e)
3939    }
@@ -61,8 +61,8 @@ fun assertError(map : Map<*,*>, vararg messageElements : String) {
6161    MatcherAssert .assertThat(errorMessage, CoreMatchers .notNullValue())
6262
6363    messageElements
64-              .filterNot { errorMessage.contains(it) }
65-              .forEach { throw  AssertionError (" Expected error message to contain $it , but was: $errorMessage "  ) }
64+         .filterNot { errorMessage.contains(it) }
65+         .forEach { throw  AssertionError (" Expected error message to contain $it , but was: $errorMessage "  ) }
6666}
6767
6868inline  fun  <reified  T : Exception > expect (message :  String?  = null, block :  () ->  Unit ){
0 commit comments