@Test public void testValidParentAsset() { ElementType elementType = new ElementType(); Asset assetBean = new Asset(); elementType.setElementTypeName("TestTypeName"); assetBean.setQualifiedName("TestAssetName"); assetBean.setType(elementType); AssetDescriptor parentAsset = new AssetSummary(assetBean); AdditionalProperties template = null; Map<String, String> propertyMap = new HashMap<>(); AssetPropertyBase assetPropertyBase = new AdditionalProperties(parentAsset, template); assertTrue(assetPropertyBase.getParentAsset() == parentAsset); assertTrue(assetPropertyBase.getParentAssetName().equals("TestAssetName")); assertTrue(assetPropertyBase.getParentAssetTypeName().equals("TestTypeName")); assetPropertyBase = new AdditionalProperties(parentAsset, propertyMap); assertTrue(assetPropertyBase.getParentAsset() == parentAsset); assertTrue(assetPropertyBase.getParentAsset().equals(parentAsset)); assertTrue(assetPropertyBase.getParentAssetName().equals("TestAssetName")); assertTrue(assetPropertyBase.getParentAssetTypeName().equals("TestTypeName")); AssetDescriptor cloneParentAsset = new AssetSummary(assetBean); template = new AdditionalProperties(cloneParentAsset, propertyMap); assetPropertyBase = new AdditionalProperties(parentAsset, template); assertFalse(assetPropertyBase.getParentAsset() == cloneParentAsset); assertTrue(assetPropertyBase.getParentAsset() == parentAsset); assertTrue(assetPropertyBase.getParentAsset().equals(cloneParentAsset)); assertTrue(assetPropertyBase.getParentAsset().equals(parentAsset)); assertTrue(assetPropertyBase.getParentAssetName().equals("TestAssetName")); assertTrue(assetPropertyBase.getParentAssetTypeName().equals("TestTypeName")); }
@Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof AdditionalProperties)) { return false; } if (!super.equals(objectToCompare)) { return false; } AdditionalProperties that = (AdditionalProperties) objectToCompare; return Objects.equals(additionalProperties, that.additionalProperties); }
AdditionalProperties extends AssetPropertyBase { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof AdditionalProperties)) { return false; } if (!super.equals(objectToCompare)) { return false; } AdditionalProperties that = (AdditionalProperties) objectToCompare; return Objects.equals(additionalProperties, that.additionalProperties); } }
AdditionalProperties extends AssetPropertyBase { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof AdditionalProperties)) { return false; } if (!super.equals(objectToCompare)) { return false; } AdditionalProperties that = (AdditionalProperties) objectToCompare; return Objects.equals(additionalProperties, that.additionalProperties); } AdditionalProperties(Map<String, String>  additionalProperties);  AdditionalProperties(AssetDescriptor     parentAsset,
                                Map<String, String> additionalProperties);  AdditionalProperties(AssetDescriptor   parentAsset, AdditionalProperties templateProperties); }
AdditionalProperties extends AssetPropertyBase { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof AdditionalProperties)) { return false; } if (!super.equals(objectToCompare)) { return false; } AdditionalProperties that = (AdditionalProperties) objectToCompare; return Objects.equals(additionalProperties, that.additionalProperties); } AdditionalProperties(Map<String, String>  additionalProperties);  AdditionalProperties(AssetDescriptor     parentAsset,
                                Map<String, String> additionalProperties);  AdditionalProperties(AssetDescriptor   parentAsset, AdditionalProperties templateProperties); Iterator<String> getPropertyNames(); String getProperty(String name); @Override boolean equals(Object objectToCompare); @Override String toString(); }
AdditionalProperties extends AssetPropertyBase { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof AdditionalProperties)) { return false; } if (!super.equals(objectToCompare)) { return false; } AdditionalProperties that = (AdditionalProperties) objectToCompare; return Objects.equals(additionalProperties, that.additionalProperties); } AdditionalProperties(Map<String, String>  additionalProperties);  AdditionalProperties(AssetDescriptor     parentAsset,
                                Map<String, String> additionalProperties);  AdditionalProperties(AssetDescriptor   parentAsset, AdditionalProperties templateProperties); Iterator<String> getPropertyNames(); String getProperty(String name); @Override boolean equals(Object objectToCompare); @Override String toString();  }