@@ -53,6 +53,39 @@ class AssetInputEntityFactoryTest extends Specification implements FactoryTestHe
5353 }
5454 }
5555
56+ def " An AssetInputFactory should parse a valid operated AssetInput correctly (with nulls and empty strings)" () {
57+ given: " a system participant input type factory and model data"
58+ def inputFactory = new TestAssetInputFactory()
59+ Map<String, String> parameter = [
60+ " uuid" : " 91ec3bcf-1777 - 4d38- af67- 0bf7c9fa73c7" ,
61+ " operatesfrom" : operatesfrom,
62+ " operatesuntil" : operatesuntil,
63+ " id" : " TestID "
64+ ]
65+ def inputClass = TestAssetInput
66+ def operatorInput = Mock(OperatorInput)
67+
68+ when:
69+ Optional<TestAssetInput> input = inputFactory.get(new AssetInputEntityData(parameter, inputClass, operatorInput))
70+
71+ then:
72+ input.present
73+ input.get().getClass() == inputClass
74+ ((TestAssetInput) input.get()).with {
75+ assert uuid == UUID.fromString(parameter[" uuid" ])
76+ assert operationTime == OperationTime.notLimited()
77+ assert operator == operatorInput
78+ assert id == parameter[" id" ]
79+ }
80+
81+ where:
82+ operatesfrom | operatesuntil
83+ null | null
84+ " " | null
85+ null | " "
86+ " " | " "
87+ }
88+
5689 def " An AssetInputFactory should parse a valid operated AssetInput correctly (operation start time provided)" () {
5790 given: " a system participant input type factory and model data"
5891 def inputFactory = new TestAssetInputFactory()
0 commit comments