aboutsummaryrefslogtreecommitdiffstats
path: root/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/test/java
diff options
context:
space:
mode:
authorRamya Balaji <rb111y@att.com>2018-01-08 12:40:57 -0500
committerSkip Wonnell <skip@att.com>2018-01-09 04:30:31 -0600
commit31540f8ba964a7d66ca04f1468db061abda5c7a1 (patch)
tree350525d885a5ab35e9312763de527cbd1aac82a1 /appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/test/java
parent36bcd566167f2f91c0e8e7a304fce5f6bc150776 (diff)
Platform hardening for appc-dg-md-sal-store
Changes made to synch up code in ONAP for bundle appc-dg-md-sal-store Issue-ID: APPC-377 Change-Id: I603918a3d6b250e5edea59818549868d4a6964fd Signed-off-by: Ramya Balaji <rb111y@att.com>
Diffstat (limited to 'appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/test/java')
-rw-r--r--appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/test/java/org/onap/appc/mdsal/MDSALStoreTest.java75
1 files changed, 75 insertions, 0 deletions
diff --git a/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/test/java/org/onap/appc/mdsal/MDSALStoreTest.java b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/test/java/org/onap/appc/mdsal/MDSALStoreTest.java
new file mode 100644
index 000000000..aa659a1b2
--- /dev/null
+++ b/appc-dg/appc-dg-shared/appc-dg-mdsal-store/appc-dg-mdsal-bundle/src/test/java/org/onap/appc/mdsal/MDSALStoreTest.java
@@ -0,0 +1,75 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.appc.mdsal;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.http.HttpResponse;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.onap.appc.mdsal.exception.MDSALStoreException;
+import org.onap.appc.mdsal.impl.MDSALStoreFactory;
+import org.onap.appc.mdsal.impl.MDSALStoreImpl;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import org.onap.appc.mdsal.operation.ConfigOperationRequestFormatter;
+import org.onap.appc.rest.client.RestClientInvoker;
+import org.osgi.framework.*;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+import java.net.URL;
+
+/**
+ * MDSALStore Tests
+ */
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({FrameworkUtil.class,BundleContext.class,ServiceReference.class,
+ BundleReference.class,Bundle.class,Filter.class,BundleListener.class,InvalidSyntaxException.class,
+ BundleException.class,FrameworkListener.class,ServiceRegistration.class,ServiceListener.class,
+ Version.class})
+public class MDSALStoreTest {
+
+ private final EELFLogger logger = EELFManager.getInstance().getLogger(MDSALStoreTest.class);
+ private RestClientInvoker client = Mockito.mock(RestClientInvoker.class);
+ private ConfigOperationRequestFormatter requestFormatter = new ConfigOperationRequestFormatter();
+ private ObjectMapper mapper = new ObjectMapper();
+ MDSALStoreImpl store;
+
+ @Before
+ public void init() throws Exception{
+ PowerMockito.whenNew(RestClientInvoker.class).withArguments(Mockito.any(URL.class)).thenReturn(client);
+ store = (MDSALStoreImpl) MDSALStoreFactory.createMDSALStore();
+ }
+
+ @Ignore
+ public void testYangInput() throws MDSALStoreException {
+ store.storeYangModuleOnLeader("module test { }", "Name");
+ }
+
+}