Skip to content

Commit

Permalink
Merge branch 'integration-branch' of github.com:rovnanik-sk/moqui-fra…
Browse files Browse the repository at this point in the history
…mework into integration-branch
  • Loading branch information
Michal Rovnanik on WS committed Nov 4, 2024
2 parents ffc5b7b + 6d716b5 commit 43060aa
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ars.rockycube.util;

import com.google.gson.Gson
import com.google.gson.JsonElement
import com.google.gson.reflect.TypeToken
import groovy.json.JsonSlurper
import groovy.yaml.YamlSlurper
import org.apache.commons.io.FileUtils
Expand Down Expand Up @@ -146,10 +147,10 @@ public class TestUtilities {
def gson = new Gson()
def js
try {
js = gson.fromJson(new InputStreamReader(is, StandardCharsets.UTF_8), HashMap.class)
js = gson.fromJson(new InputStreamReader(is, StandardCharsets.UTF_8), new TypeToken<LinkedHashMap<String, Object>>(){}.getType())
} catch (Exception ignored) {
is = loadTestResource(resDir)
js = gson.fromJson(new InputStreamReader(is, StandardCharsets.UTF_8), ArrayList.class)
js = gson.fromJson(new InputStreamReader(is, StandardCharsets.UTF_8), new TypeToken<ArrayList<Object>>(){}.getType())
}
return js
}
Expand Down
46 changes: 46 additions & 0 deletions framework/src/test/groovy/UtilsTests.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -447,4 +447,50 @@ class UtilsTests extends Specification {

assert true
}

/**
* Establishing permanent testing of an important procedure that converts closure
* configurations to lazymaps
*/
def test_hashmap_conversion_to_lazymap(){
when:

def conf = [
keyword : "online-sxl-extract",
hasDetailedStorage: true,
storageAppendix : "nothing_to_store",
detailProcessing : [
initial: [
type: "clean-processing"
]
],
initial : [
filler: [
mergeStrategy: [
type: "Simplify"
],
fillFormData : [
[
1: [
list : "teams",
"sp-location": [
sharepointUrl: "https://rovnaniksk.sharepoint.com",
site : "/sites/CML/Billing",
list : "sxl_enum_teams",
fields : ["Title", "ID"]
]
]
]
]
]
]
]

// convert it
def conv = CollectionUtils.convertLinkedHashMapToLazyMap(conf)

then:

assert true
}
}

0 comments on commit 43060aa

Please sign in to comment.