SONAR assertion cleanup
[policy/apex-pdp.git] / model / policy-model / src / test / java / org / onap / policy / apex / model / policymodel / concepts / StateTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
4  *  Modifications Copyright (C) 2020 Nordix Foundation
5  * ================================================================================
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * SPDX-License-Identifier: Apache-2.0
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.policy.apex.model.policymodel.concepts;
23
24 import static org.assertj.core.api.Assertions.assertThatThrownBy;
25 import static org.junit.Assert.assertEquals;
26 import static org.junit.Assert.assertNotEquals;
27 import static org.junit.Assert.assertNotNull;
28
29 import java.util.Set;
30 import java.util.TreeMap;
31 import java.util.TreeSet;
32 import org.junit.Test;
33 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
34 import org.onap.policy.apex.model.basicmodel.concepts.AxKey;
35 import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
36 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
37 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.ValidationResult;
38
39 /**
40  * Test policy states.
41  *
42  * @author Liam Fallon (liam.fallon@ericsson.com)
43  */
44 public class StateTest {
45
46     @Test
47     public void testState() {
48         final TreeMap<String, AxStateOutput> soEmptyMap = new TreeMap<>();
49         final TreeSet<AxArtifactKey> ctxtEmptySet = new TreeSet<>();
50         final TreeMap<String, AxStateFinalizerLogic> sflEmptyMap = new TreeMap<>();
51         final TreeMap<AxArtifactKey, AxStateTaskReference> trEmptyMap = new TreeMap<>();
52
53         final TreeMap<String, AxStateOutput> soMap = new TreeMap<>();
54         final TreeSet<AxArtifactKey> ctxtSet = new TreeSet<>();
55         final TreeMap<String, AxStateFinalizerLogic> sflMap = new TreeMap<>();
56         final TreeMap<AxArtifactKey, AxStateTaskReference> trMap = new TreeMap<>();
57
58         assertNotNull(new AxState());
59         assertNotNull(new AxState(new AxReferenceKey()));
60         assertNotNull(new AxState(new AxStateParamsBuilder().key(new AxReferenceKey()).trigger(new AxArtifactKey())
61                         .stateOutputs(soEmptyMap).contextAlbumReferenceSet(ctxtEmptySet)
62                         .taskSelectionLogic(new AxTaskSelectionLogic()).stateFinalizerLogicMap(sflEmptyMap)
63                         .defaultTask(new AxArtifactKey()).taskReferenceMap(trEmptyMap)));
64
65         final AxState state = new AxState();
66
67         final AxReferenceKey stateKey = new AxReferenceKey("PolicyName", "0.0.1", "StateName");
68         final AxReferenceKey stateKeyNext = new AxReferenceKey("PolicyName", "0.0.1", "StateNameNext");
69         final AxReferenceKey stateKeyBad = new AxReferenceKey("PolicyName", "0.0.1", "BadStateName");
70         final AxArtifactKey triggerKey = new AxArtifactKey("TriggerName", "0.0.1");
71         final AxTaskSelectionLogic tsl = new AxTaskSelectionLogic(stateKey, "TSL", "LogicFlavour", "Some Logic");
72         final AxArtifactKey defTaskKey = new AxArtifactKey("TaskName", "0.0.1");
73         final AxArtifactKey taskKey1 = new AxArtifactKey("Task1", "0.0.1");
74         final AxArtifactKey taskKey2 = new AxArtifactKey("Task2", "0.0.1");
75         final AxArtifactKey taskKeyBad = new AxArtifactKey("TaskBad", "0.0.1");
76
77         assertThatThrownBy(() -> state.setKey(null))
78             .hasMessage("key may not be null");
79         state.setKey(stateKey);
80         assertEquals("PolicyName:0.0.1:NULL:StateName", state.getKey().getId());
81         assertEquals("PolicyName:0.0.1:NULL:StateName", state.getKeys().get(0).getId());
82
83         final AxStateOutput so0 = new AxStateOutput(new AxReferenceKey(stateKey, "SO0"), triggerKey,
84                         new AxReferenceKey());
85         final AxStateOutput soU = new AxStateOutput(new AxReferenceKey(stateKey, "SOU"), triggerKey, stateKeyNext);
86         final AxStateOutput soSame = new AxStateOutput(new AxReferenceKey(stateKey, "SOU"), triggerKey, stateKey);
87         final AxArtifactKey cr0 = new AxArtifactKey("ContextReference", "0.0.1");
88         final AxStateFinalizerLogic sfl = new AxStateFinalizerLogic(stateKey, "SFLogicName", "LogicFlavour", "Logic");
89         final AxStateFinalizerLogic sflU = new AxStateFinalizerLogic(stateKey, "UnusedSFLogicName", "LogicFlavour",
90                         "Logic");
91         final AxStateTaskReference str0 = new AxStateTaskReference(new AxReferenceKey(stateKey, "STR0"),
92                         AxStateTaskOutputType.DIRECT, so0.getKey());
93         final AxStateTaskReference str1 = new AxStateTaskReference(new AxReferenceKey(stateKey, "STR1"),
94                         AxStateTaskOutputType.DIRECT, so0.getKey());
95         final AxStateTaskReference str2 = new AxStateTaskReference(new AxReferenceKey(stateKey, "STR2"),
96                         AxStateTaskOutputType.LOGIC, sfl.getKey());
97
98         final AxStateTaskReference strBadState = new AxStateTaskReference(new AxReferenceKey(stateKeyBad, "STR2"),
99                         AxStateTaskOutputType.LOGIC, sfl.getKey());
100         final AxStateTaskReference strBadStateOutput = new AxStateTaskReference(new AxReferenceKey(stateKey, "STR2"),
101                         AxStateTaskOutputType.UNDEFINED, sfl.getKey());
102         final AxStateTaskReference strBadStateFinalizerLogic = new AxStateTaskReference(
103                         new AxReferenceKey(stateKeyBad, "STR2"), AxStateTaskOutputType.LOGIC,
104                         new AxReferenceKey(stateKey, "SomeSFL"));
105
106         soMap.put(so0.getKey().getLocalName(), so0);
107         ctxtSet.add(cr0);
108         sflMap.put(sfl.getKey().getLocalName(), sfl);
109         trMap.put(defTaskKey.getKey(), str0);
110         trMap.put(taskKey1.getKey(), str1);
111         trMap.put(taskKey2.getKey(), str2);
112
113         assertThatThrownBy(() -> state.setTrigger(null))
114             .hasMessage("trigger may not be null");
115         state.setTrigger(triggerKey);
116         assertEquals(triggerKey, state.getTrigger());
117
118         assertThatThrownBy(() -> state.setStateOutputs(null))
119             .hasMessage("stateOutputs may not be null");
120         state.setStateOutputs(soMap);
121         assertEquals(soMap, state.getStateOutputs());
122
123         assertThatThrownBy(() -> state.setContextAlbumReferences(null))
124             .hasMessage("contextAlbumReferenceSet may not be null");
125         state.setContextAlbumReferences(ctxtSet);
126         assertEquals(ctxtSet, state.getContextAlbumReferences());
127
128         assertThatThrownBy(() -> state.setTaskSelectionLogic(null))
129             .hasMessage("taskSelectionLogic may not be null");
130         assertEquals(false, state.checkSetTaskSelectionLogic());
131         state.setTaskSelectionLogic(tsl);
132         assertEquals(tsl, state.getTaskSelectionLogic());
133         assertEquals(true, state.checkSetTaskSelectionLogic());
134
135         assertThatThrownBy(() -> state.setStateFinalizerLogicMap(null))
136             .hasMessage("stateFinalizerLogic may not be null");
137         state.setStateFinalizerLogicMap(sflMap);
138         assertEquals(sflMap, state.getStateFinalizerLogicMap());
139
140         assertThatThrownBy(() -> state.setDefaultTask(null))
141             .hasMessage("defaultTask may not be null");
142         state.setDefaultTask(defTaskKey);
143         assertEquals(defTaskKey, state.getDefaultTask());
144
145         assertThatThrownBy(() -> state.setTaskReferences(null))
146             .hasMessage("taskReferenceMap may not be null");
147         state.setTaskReferences(trMap);
148         assertEquals(trMap, state.getTaskReferences());
149
150         state.afterUnmarshal(null, null);
151         assertEquals(state.getKey(), state.getKeys().get(0));
152         state.getTaskSelectionLogic().getKey().setLocalName(AxKey.NULL_KEY_NAME);
153         state.afterUnmarshal(null, null);
154         assertEquals(state.getKey(), state.getKeys().get(0));
155
156         final Set<String> stateSet = state.getNextStateSet();
157         assertEquals(1, stateSet.size());
158
159         AxValidationResult result = new AxValidationResult();
160         result = state.validate(result);
161         assertEquals(ValidationResult.VALID, result.getValidationResult());
162
163         state.setKey(AxReferenceKey.getNullKey());
164         result = new AxValidationResult();
165         result = state.validate(result);
166         assertEquals(ValidationResult.INVALID, result.getValidationResult());
167
168         state.setKey(stateKey);
169         result = new AxValidationResult();
170         result = state.validate(result);
171         assertEquals(ValidationResult.VALID, result.getValidationResult());
172
173         state.setTrigger(AxArtifactKey.getNullKey());
174         result = new AxValidationResult();
175         result = state.validate(result);
176         assertEquals(ValidationResult.INVALID, result.getValidationResult());
177
178         state.setTrigger(triggerKey);
179         result = new AxValidationResult();
180         result = state.validate(result);
181         assertEquals(ValidationResult.VALID, result.getValidationResult());
182
183         state.setStateOutputs(soEmptyMap);
184         result = new AxValidationResult();
185         result = state.validate(result);
186         assertEquals(ValidationResult.INVALID, result.getValidationResult());
187
188         state.setStateOutputs(soMap);
189         result = new AxValidationResult();
190         result = state.validate(result);
191         assertEquals(ValidationResult.VALID, result.getValidationResult());
192
193         so0.getKey().setParentLocalName("Zooby");
194         result = new AxValidationResult();
195         result = state.validate(result);
196         assertEquals(ValidationResult.INVALID, result.getValidationResult());
197
198         so0.getKey().setParentLocalName("StateName");
199         state.setStateOutputs(soMap);
200         result = new AxValidationResult();
201         result = state.validate(result);
202         assertEquals(ValidationResult.VALID, result.getValidationResult());
203
204         soMap.put("NullOutput", null);
205         result = new AxValidationResult();
206         result = state.validate(result);
207         assertEquals(ValidationResult.INVALID, result.getValidationResult());
208
209         soMap.remove("NullOutput");
210         state.setStateOutputs(soMap);
211         result = new AxValidationResult();
212         result = state.validate(result);
213         assertEquals(ValidationResult.VALID, result.getValidationResult());
214
215         soMap.put("DupOutput", so0);
216         result = new AxValidationResult();
217         result = state.validate(result);
218         assertEquals(ValidationResult.INVALID, result.getValidationResult());
219
220         soMap.remove("DupOutput");
221         state.setStateOutputs(soMap);
222         result = new AxValidationResult();
223         result = state.validate(result);
224         assertEquals(ValidationResult.VALID, result.getValidationResult());
225
226         soMap.put("UnusedOutput", soU);
227         result = new AxValidationResult();
228         result = state.validate(result);
229         assertEquals(ValidationResult.OBSERVATION, result.getValidationResult());
230
231         soMap.remove("UnusedOutput");
232         state.setStateOutputs(soMap);
233         result = new AxValidationResult();
234         result = state.validate(result);
235         assertEquals(ValidationResult.VALID, result.getValidationResult());
236
237         soMap.put("OutputToSameState", soSame);
238         result = new AxValidationResult();
239         result = state.validate(result);
240         assertEquals(ValidationResult.INVALID, result.getValidationResult());
241
242         soMap.remove("OutputToSameState");
243         state.setStateOutputs(soMap);
244         result = new AxValidationResult();
245         result = state.validate(result);
246         assertEquals(ValidationResult.VALID, result.getValidationResult());
247
248         // Empty context reference set is OK
249         state.setContextAlbumReferences(ctxtEmptySet);
250         result = new AxValidationResult();
251         result = state.validate(result);
252         assertEquals(ValidationResult.VALID, result.getValidationResult());
253
254         state.setContextAlbumReferences(ctxtSet);
255         result = new AxValidationResult();
256         result = state.validate(result);
257         assertEquals(ValidationResult.VALID, result.getValidationResult());
258
259         ctxtSet.add(AxArtifactKey.getNullKey());
260         result = new AxValidationResult();
261         result = state.validate(result);
262         assertEquals(ValidationResult.INVALID, result.getValidationResult());
263
264         ctxtSet.remove(AxArtifactKey.getNullKey());
265         result = new AxValidationResult();
266         result = state.validate(result);
267         assertEquals(ValidationResult.VALID, result.getValidationResult());
268
269         // Null TSL is OK
270         state.getTaskSelectionLogic().setKey(AxReferenceKey.getNullKey());
271         result = new AxValidationResult();
272         result = state.validate(result);
273         assertEquals(ValidationResult.VALID, result.getValidationResult());
274
275         state.getTaskSelectionLogic().setKey(new AxReferenceKey(stateKey, "TSL"));
276         result = new AxValidationResult();
277         result = state.validate(result);
278         assertEquals(ValidationResult.VALID, result.getValidationResult());
279
280         state.setDefaultTask(AxArtifactKey.getNullKey());
281         result = new AxValidationResult();
282         result = state.validate(result);
283         assertEquals(ValidationResult.INVALID, result.getValidationResult());
284
285         state.setDefaultTask(defTaskKey);
286         result = new AxValidationResult();
287         result = state.validate(result);
288         assertEquals(ValidationResult.VALID, result.getValidationResult());
289
290         state.setTaskReferences(trEmptyMap);
291         result = new AxValidationResult();
292         result = state.validate(result);
293         assertEquals(ValidationResult.INVALID, result.getValidationResult());
294
295         state.setTaskReferences(trMap);
296         result = new AxValidationResult();
297         result = state.validate(result);
298         assertEquals(ValidationResult.VALID, result.getValidationResult());
299
300         trMap.put(AxArtifactKey.getNullKey(), null);
301         result = new AxValidationResult();
302         result = state.validate(result);
303         assertEquals(ValidationResult.INVALID, result.getValidationResult());
304
305         trMap.remove(AxArtifactKey.getNullKey());
306         result = new AxValidationResult();
307         result = state.validate(result);
308         assertEquals(ValidationResult.VALID, result.getValidationResult());
309
310         trMap.put(AxArtifactKey.getNullKey(), str0);
311         result = new AxValidationResult();
312         result = state.validate(result);
313         assertEquals(ValidationResult.INVALID, result.getValidationResult());
314
315         trMap.remove(AxArtifactKey.getNullKey());
316         result = new AxValidationResult();
317         result = state.validate(result);
318         assertEquals(ValidationResult.VALID, result.getValidationResult());
319
320         trMap.put(taskKeyBad, strBadStateOutput);
321         result = new AxValidationResult();
322         result = state.validate(result);
323         assertEquals(ValidationResult.INVALID, result.getValidationResult());
324
325         trMap.remove(taskKeyBad);
326         result = new AxValidationResult();
327         result = state.validate(result);
328         assertEquals(ValidationResult.VALID, result.getValidationResult());
329
330         trMap.put(taskKeyBad, strBadState);
331         result = new AxValidationResult();
332         result = state.validate(result);
333         assertEquals(ValidationResult.INVALID, result.getValidationResult());
334
335         trMap.remove(taskKeyBad);
336         result = new AxValidationResult();
337         result = state.validate(result);
338         assertEquals(ValidationResult.VALID, result.getValidationResult());
339
340         trMap.put(taskKeyBad, strBadStateFinalizerLogic);
341         result = new AxValidationResult();
342         result = state.validate(result);
343         assertEquals(ValidationResult.INVALID, result.getValidationResult());
344
345         trMap.remove(taskKeyBad);
346         result = new AxValidationResult();
347         result = state.validate(result);
348         assertEquals(ValidationResult.VALID, result.getValidationResult());
349
350         state.setDefaultTask(new AxArtifactKey("NonExistantTask", "0.0.1"));
351         result = new AxValidationResult();
352         result = state.validate(result);
353         assertEquals(ValidationResult.INVALID, result.getValidationResult());
354
355         state.setDefaultTask(defTaskKey);
356         result = new AxValidationResult();
357         result = state.validate(result);
358         assertEquals(ValidationResult.VALID, result.getValidationResult());
359
360         sflMap.put("NullSFL", null);
361         result = new AxValidationResult();
362         result = state.validate(result);
363         assertEquals(ValidationResult.INVALID, result.getValidationResult());
364
365         sflMap.remove("NullSFL");
366         result = new AxValidationResult();
367         result = state.validate(result);
368         assertEquals(ValidationResult.VALID, result.getValidationResult());
369
370         sflMap.put(sflU.getKey().getLocalName(), sflU);
371         result = new AxValidationResult();
372         result = state.validate(result);
373         assertEquals(ValidationResult.OBSERVATION, result.getValidationResult());
374
375         sflMap.remove(sflU.getKey().getLocalName());
376         result = new AxValidationResult();
377         result = state.validate(result);
378         assertEquals(ValidationResult.VALID, result.getValidationResult());
379
380         state.clean();
381
382         final AxState clonedState = new AxState(state);
383         assertEquals("AxState:(stateKey=AxReferenceKey:(parent", clonedState.toString().substring(0, 40));
384
385         assertNotEquals(0, state.hashCode());
386         // disabling sonar because this code tests the equals() method
387         assertEquals(state, state); // NOSONAR
388         assertEquals(state, clonedState);
389         assertNotNull(state);
390         assertNotEquals(state, "Hello");
391         assertNotEquals(state, new AxState(new AxStateParamsBuilder().key(new AxReferenceKey()).trigger(triggerKey)
392                         .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl)
393                         .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap)));
394         assertNotEquals(state, new AxState(new AxStateParamsBuilder().key(stateKey).trigger(new AxArtifactKey())
395                         .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl)
396                         .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap)));
397         assertNotEquals(state, new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey)
398                         .stateOutputs(soEmptyMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl)
399                         .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap)));
400         assertNotEquals(state, new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey)
401                         .stateOutputs(soMap).contextAlbumReferenceSet(ctxtEmptySet).taskSelectionLogic(tsl)
402                         .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap)));
403         assertNotEquals(state, new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey)
404                         .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet)
405                         .taskSelectionLogic(new AxTaskSelectionLogic()).stateFinalizerLogicMap(sflMap)
406                         .defaultTask(defTaskKey).taskReferenceMap(trMap)));
407         assertNotEquals(state, new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey)
408                         .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl)
409                         .stateFinalizerLogicMap(sflEmptyMap).defaultTask(defTaskKey).taskReferenceMap(trMap)));
410         assertNotEquals(state, new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey)
411                         .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl)
412                         .stateFinalizerLogicMap(sflMap).defaultTask(new AxArtifactKey()).taskReferenceMap(trMap)));
413         assertNotEquals(state, new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey)
414                         .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl)
415                         .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trEmptyMap)));
416         assertEquals(state, new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey)
417                      .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl)
418                      .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap)));
419
420         assertEquals(0, state.compareTo(state));
421         assertEquals(0, state.compareTo(clonedState));
422         assertNotEquals(0, state.compareTo(new AxArtifactKey()));
423         assertNotEquals(0, state.compareTo(null));
424         assertNotEquals(0,
425                         state.compareTo(new AxState(new AxStateParamsBuilder().key(new AxReferenceKey())
426                                         .trigger(triggerKey).stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet)
427                                         .taskSelectionLogic(tsl).stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey)
428                                         .taskReferenceMap(trMap))));
429         assertNotEquals(0, state.compareTo(new AxState(new AxStateParamsBuilder().key(stateKey)
430                         .trigger(new AxArtifactKey()).stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet)
431                         .taskSelectionLogic(tsl).stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey)
432                         .taskReferenceMap(trMap))));
433         assertNotEquals(0, state.compareTo(new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey)
434                         .stateOutputs(soEmptyMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl)
435                         .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap))));
436         assertNotEquals(0, state.compareTo(new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey)
437                         .stateOutputs(soMap).contextAlbumReferenceSet(ctxtEmptySet).taskSelectionLogic(tsl)
438                         .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap))));
439         assertNotEquals(0,
440                         state.compareTo(new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey)
441                                         .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet)
442                                         .taskSelectionLogic(new AxTaskSelectionLogic()).stateFinalizerLogicMap(sflMap)
443                                         .defaultTask(defTaskKey).taskReferenceMap(trMap))));
444         assertNotEquals(0, state.compareTo(new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey)
445                         .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl)
446                         .stateFinalizerLogicMap(sflEmptyMap).defaultTask(defTaskKey).taskReferenceMap(trMap))));
447         assertNotEquals(0, state.compareTo(new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey)
448                         .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl)
449                         .stateFinalizerLogicMap(sflMap).defaultTask(new AxArtifactKey()).taskReferenceMap(trMap))));
450         assertNotEquals(0, state.compareTo(new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey)
451                         .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl)
452                         .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trEmptyMap))));
453         assertEquals(0, state.compareTo(new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey)
454                         .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl)
455                         .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap))));
456
457         assertNotNull(state.getKeys());
458     }
459 }