Fix for assertions comparing dissimiliar types.
Issue-ID: POLICY-2761
Change-Id: I1b2b8afa3e6308cda887d73a4ee079709847d054
Signed-off-by: waynedunican <wayne.dunican@est.tech>
// disabling sonar because this code tests the equals() method
assertEquals(response, response); // NOSONAR
assertNotNull(response);
- assertNotEquals(response, new StartEngine(new AxArtifactKey()));
+ assertNotEquals(response, (Object) new StartEngine(new AxArtifactKey()));
response = new EngineServiceInfoResponse(null, false, null);
EngineServiceInfoResponse otherResponse = new EngineServiceInfoResponse(null, false, null);
assertEquals(testKeyInfo, testKeyInfo); // NOSONAR
assertEquals(testKeyInfo, clonedReferenceKey);
assertNotNull(testKeyInfo);
- assertNotEquals(testKeyInfo, new AxArtifactKey());
+ assertNotEquals(testKeyInfo, (Object) new AxArtifactKey());
assertNotEquals(testKeyInfo, new AxKeyInfo(new AxArtifactKey()));
assertNotEquals(testKeyInfo, new AxKeyInfo(key, UUID.randomUUID(), "Some Description"));
assertNotEquals(testKeyInfo, new AxKeyInfo(key, uuid, "Some Description"));
assertNotNull(someKey0);
// disabling sonar because this code tests the equals() method
assertEquals(someKey0, someKey0); // NOSONAR
- assertNotEquals(someKey0, new AxReferenceKey());
+ assertNotEquals(someKey0, (Object) new AxReferenceKey());
AxArtifactKey nullKey0 = AxArtifactKey.getNullKey();
assertTrue(nullKey0.isNullKey());
// disabling sonar because this code tests the equals() method
assertEquals(keyUse, keyUse); // NOSONAR
assertEquals(keyUse, clonedKeyUse);
- assertNotEquals(keyUse, "Hello");
+ assertNotEquals(keyUse, (Object) "Hello");
assertEquals(keyUse, new AxKeyUse(key));
assertEquals(0, keyUse.compareTo(keyUse));
// disabling sonar because this code tests the equals() method
assertEquals(testReferenceKey, testReferenceKey); // NOSONAR
assertEquals(testReferenceKey, clonedReferenceKey);
- assertNotEquals(testReferenceKey, "Hello");
+ assertNotEquals(testReferenceKey, (Object) "Hello");
assertNotEquals(testReferenceKey, new AxReferenceKey("PKN", "0.0.2", "PLN", "LN"));
assertNotEquals(testReferenceKey, new AxReferenceKey("NPKN", "0.0.2", "PLN", "LN"));
assertNotEquals(testReferenceKey, new AxReferenceKey("NPKN", "0.0.1", "PLN", "LN"));
assertEquals(model, model); // NOSONAR
assertEquals(model, clonedModel);
assertNotNull(model);
- assertNotEquals(model, "Hello");
+ assertNotEquals(model, (Object) "Hello");
clonedModel.getKey().setVersion("0.0.2");
assertNotEquals(model, clonedModel);
clonedModel.getKey().setVersion("0.0.1");
final AxKeyInformation clonedKeyI = new AxKeyInformation(keyI);
assertNotNull(keyI);
- assertNotEquals(keyI, new AxArtifactKey());
+ assertNotEquals(keyI, (Object) new AxArtifactKey());
assertEquals(keyI, clonedKeyI);
clonedKeyI.setKey(new AxArtifactKey());
assertEquals(album, album); // NOSONAR
assertEquals(album, clonedAlbum);
assertNotNull(album);
- assertNotEquals(album, "Hello");
+ assertNotEquals(album, (Object) "Hello");
assertNotEquals(album, new AxContextAlbum(new AxArtifactKey(), "Scope", false, AxArtifactKey.getNullKey()));
assertNotEquals(album, new AxContextAlbum(newKey, "Scope", false, AxArtifactKey.getNullKey()));
assertNotEquals(album, new AxContextAlbum(newKey, "NewAlbumScope", false, AxArtifactKey.getNullKey()));
assertEquals(albums, clonedAlbums);
assertNotNull(albums);
- assertNotEquals(albums, "Hello");
+ assertNotEquals(albums, (Object) "Hello");
assertNotEquals(albums, new AxContextAlbums(new AxArtifactKey()));
assertEquals(0, albums.compareTo(albums));
// disabling sonar because this code tests the equals() method
assertEquals(model, model); // NOSONAR
assertEquals(model, clonedModel);
- assertNotEquals(model, "Hello");
+ assertNotEquals(model, (Object) "Hello");
assertNotEquals(model, new AxContextModel(new AxArtifactKey()));
assertNotEquals(model, new AxContextModel(new AxArtifactKey(), new AxContextSchemas(), new AxContextAlbums(),
new AxKeyInformation()));
assertEquals(schema, schema); // NOSONAR
assertEquals(schema, clonedSchema);
assertNotNull(schema);
- assertNotEquals(schema, "Hello");
+ assertNotEquals(schema, (Object) "Hello");
assertNotEquals(schema, new AxContextSchema(new AxArtifactKey(), "Flavour", "Def"));
assertNotEquals(schema, new AxContextSchema(newKey, "Flavour", "Def"));
assertNotEquals(schema, new AxContextSchema(newKey, "NewSchemaFlavour", "Def"));
assertEquals(schemas, clonedSchemas);
assertNotNull(schemas);
- assertNotEquals(schemas, "Hello");
+ assertNotEquals(schemas, (Object) "Hello");
assertNotEquals(schemas, new AxContextSchemas(new AxArtifactKey()));
assertEquals(0, schemas.compareTo(schemas));
// disabling sonar because this code tests the equals() method
assertEquals(model, model); // NOSONAR
assertEquals(model, clonedModel);
- assertNotEquals(model, "Hello");
+ assertNotEquals(model, (Object) "Hello");
assertNotEquals(model, new AxEngineModel(new AxArtifactKey()));
assertNotEquals(model, new AxEngineModel(new AxArtifactKey(), new AxContextSchemas(schemasKey),
new AxKeyInformation(keyInfoKey), new AxContextAlbums(albumKey), AxEngineState.READY, stats));
// disabling sonar because this code tests the equals() method
assertEquals(model, model); // NOSONAR
assertEquals(model, clonedModel);
- assertNotEquals(model, "Hello");
+ assertNotEquals(model, (Object) "Hello");
assertNotEquals(model, new AxEventModel(new AxArtifactKey()));
assertNotEquals(model, new AxEventModel(modelKey, new AxContextSchemas(), new AxKeyInformation(keyInfoKey),
new AxEvents(eventsKey)));
assertEquals(event, event); // NOSONAR
assertEquals(event, clonedEvent);
assertNotNull(event);
- assertNotEquals(event, "Hello");
+ assertNotEquals(event, (Object) "Hello");
assertNotEquals(
event, new AxEvent(AxArtifactKey.getNullKey(), "namespace", "source", "target", parameterMap));
assertNotEquals(event, new AxEvent(eventKey, "namespace1", "source", "target", parameterMap));
assertEquals(events, clonedEvents);
assertNotNull(events);
- assertNotEquals(events, "Hello");
+ assertNotEquals(events, (Object) "Hello");
assertNotEquals(events, new AxEvents(new AxArtifactKey()));
assertEquals(0, events.compareTo(events));
assertEquals(field, field); // NOSONAR
assertEquals(field, clonedField);
assertNotNull(field);
- assertNotEquals(field, "Hello");
+ assertNotEquals(field, (Object) "Hello");
assertNotEquals(field, new AxField(AxReferenceKey.getNullKey(), AxArtifactKey.getNullKey(), false));
assertNotEquals(field, new AxField(fieldKey, AxArtifactKey.getNullKey(), false));
assertNotEquals(field, new AxField(fieldKey, schemaKey, false));
assertEquals(logic, logic); // NOSONAR
assertEquals(logic, clonedLogic);
assertNotNull(logic);
- assertNotEquals(logic, "Hello");
+ assertNotEquals(logic, (Object) "Hello");
assertNotEquals(logic, new AxLogic(AxReferenceKey.getNullKey(), "LogicFlavour", "Logic"));
assertNotEquals(logic, new AxLogic(logicKey, "AnotherLogicFlavour", "Logic"));
assertNotEquals(logic, new AxLogic(logicKey, "LogicFlavour", "AnotherLogic"));
assertEquals(policyPN, policyPN); // NOSONAR
assertEquals(policyPN, clonedPolicy);
assertNotNull(policyPN);
- assertNotEquals(policyPN, "Hello");
+ assertNotEquals(policyPN, (Object) "Hello");
assertNotEquals(policyPN,
new AxPolicy(AxArtifactKey.getNullKey(), savedTemplate, savedStateMap, savedFirstState));
assertNotEquals(policyPN, new AxPolicy(savedPolicyKey, "SomeTemplate", savedStateMap, savedFirstState));
assertEquals(policies, policies); // NOSONAR
assertEquals(policies, clonedPolicies);
assertNotNull(policies);
- assertNotEquals(policies, "Hello");
+ assertNotEquals(policies, (Object) "Hello");
assertNotEquals(policies, new AxPolicies(new AxArtifactKey()));
assertEquals(0, policies.compareTo(policies));
// disabling sonar because this code tests the equals() method
assertEquals(model, model); // NOSONAR
assertEquals(model, clonedModel);
- assertNotEquals(model, "Hello");
+ assertNotEquals(model, (Object) "Hello");
assertNotEquals(model, new AxPolicyModel(new AxArtifactKey()));
assertNotEquals(model, new AxPolicyModel(AxArtifactKey.getNullKey(), new AxContextSchemas(schemasKey),
new AxKeyInformation(keyInfoKey), new AxEvents(eventsKey), new AxContextAlbums(albumsKey),
assertEquals(so, so); // NOSONAR
assertEquals(so, clonedPar);
assertNotNull(so);
- assertNotEquals(so, "Hello");
+ assertNotEquals(so, (Object) "Hello");
assertNotEquals(so, new AxStateOutput(AxReferenceKey.getNullKey(), eKey, nsKey));
assertNotEquals(so, new AxStateOutput(soKey, new AxArtifactKey(), nsKey));
assertNotEquals(so, new AxStateOutput(soKey, eKey, new AxReferenceKey()));
assertEquals(stRef, stRef); // NOSONAR
assertEquals(stRef, clonedStRef);
assertNotNull(stRef);
- assertNotEquals(stRef, "Hello");
+ assertNotEquals(stRef, (Object) "Hello");
assertNotEquals(stRef, new AxStateTaskReference(AxReferenceKey.getNullKey(), AxStateTaskOutputType.LOGIC,
soKey));
assertNotEquals(stRef, new AxStateTaskReference(stRefKey, AxStateTaskOutputType.DIRECT, soKey));
assertEquals(state, state); // NOSONAR
assertEquals(state, clonedState);
assertNotNull(state);
- assertNotEquals(state, "Hello");
+ assertNotEquals(state, (Object) "Hello");
assertNotEquals(state, new AxState(new AxStateParamsBuilder().key(new AxReferenceKey()).trigger(triggerKey)
.stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl)
.stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap)));
assertEquals(par, par); // NOSONAR
assertEquals(par, clonedPar);
assertNotNull(par);
- assertNotEquals(par, "Hello");
+ assertNotEquals(par, (Object) "Hello");
assertNotEquals(par, new AxTaskParameter(AxReferenceKey.getNullKey(), "DefaultValue"));
assertNotEquals(par, new AxTaskParameter(parKey, "OtherDefaultValue"));
assertEquals(par, new AxTaskParameter(parKey, "DefaultValue"));
assertEquals(task, task); // NOSONAR
assertEquals(task, clonedTask);
assertNotNull(task);
- assertNotEquals(task, "Hello");
+ assertNotEquals(task, (Object) "Hello");
assertNotEquals(task, new AxTask(new AxArtifactKey(), ifMap, ofMap, tpMap, ctxtSet, tl));
assertNotEquals(task, new AxTask(taskKey, ifEmptyMap, ofMap, tpMap, ctxtSet, tl));
assertNotEquals(task, new AxTask(taskKey, ifMap, ofEmptyMap, tpMap, ctxtSet, tl));
assertEquals(tasks, tasks); // NOSONAR
assertEquals(tasks, clonedTasks);
assertNotNull(tasks);
- assertNotEquals(tasks, "Hello");
+ assertNotEquals(tasks, (Object) "Hello");
assertNotEquals(tasks, new AxTasks(new AxArtifactKey()));
assertEquals(0, tasks.compareTo(tasks));
assertEquals("This is a slogan", slogan2);
final byte mc21 = (byte) event.get("TestMatchCase");
- assertNotNull(mc21);
assertEquals(16, mc21);
final byte mc22 = (byte) event.get("TestMatchCase");
- assertNotNull(mc22);
assertEquals((byte) 16, mc22);
final long timestamp2 = (Long) event.get("TestTimestamp");
- assertNotNull(timestamp2);
assertEquals(timestamp2, timestamp1);
final double temp2 = (double) event.get("TestTemperature");
- assertNotNull(temp2);
assertEquals(123.456789, temp2, 0);
final Double temp3 = (Double) event.get("TestTemperature");
assertEquals("This is a test slogan", slogan3);
final byte mc31 = (byte) event.get("TestMatchCase");
- assertNotNull(mc31);
assertEquals((byte) 123, mc31);
final long timestamp3 = (Long) event.get("TestTimestamp");
- assertNotNull(timestamp3);
assertEquals(timestamp3, aDate.getTime());
final double temp4 = (double) event.get("TestTemperature");
- assertNotNull(temp4);
assertEquals(34.5445667, temp4, 0);
logger.debug(event.toString());