From d7422e0ef739a61cadd536da1967174562d053ad Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Fri, 1 Mar 2019 16:31:24 +0530 Subject: added test cases to CachedElementTest.java to increase code coverage Issue-ID: APPC-1086 Change-Id: Idfb3ce36d41fdec4a5286da63b8a9592c1c83a96 Signed-off-by: Sandeep J --- .../java/org/onap/appc/pool/CachedElementTest.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'appc-core/appc-common-bundle') diff --git a/appc-core/appc-common-bundle/src/test/java/org/onap/appc/pool/CachedElementTest.java b/appc-core/appc-common-bundle/src/test/java/org/onap/appc/pool/CachedElementTest.java index 02bdd3be3..0d0c08ad9 100644 --- a/appc-core/appc-common-bundle/src/test/java/org/onap/appc/pool/CachedElementTest.java +++ b/appc-core/appc-common-bundle/src/test/java/org/onap/appc/pool/CachedElementTest.java @@ -6,6 +6,8 @@ * ================================================================================ * Copyright (C) 2017 Amdocs * ============================================================================= + * Modifications Copyright (C) 2019 IBM + * ============================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -27,6 +29,7 @@ package org.onap.appc.pool; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertSame; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; @@ -272,4 +275,21 @@ public class CachedElementTest implements Allocator, Destructor pool) { destroyCount++; } + + @Test + public void testGetWrappedObject() + { + Testable element = new Element(index++); + CachedElement cachedElement = new CachedElement(pool, element); + assertNotNull(cachedElement.getWrappedObject()); + assertSame(element, cachedElement.getWrappedObject()); + } + + @Test + public void testToString() + { + Testable element = new Element(index++); + CachedElement cachedElement = new CachedElement(pool, element); + assertTrue(cachedElement.toString() instanceof String); + } } -- cgit 1.2.3-korg