2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.vid.asdc;
23 import java.io.IOException;
24 import java.io.InputStream;
25 import java.net.URISyntaxException;
27 import org.codehaus.jackson.map.ObjectMapper;
28 import org.json.JSONObject;
29 import org.json.JSONTokener;
30 import org.junit.Before;
31 import org.junit.Test;
32 import org.onap.vid.asdc.memory.InMemoryAsdcClient;
35 * The Class InMemoryClientTest.
37 public class InMemoryClientTest extends BaseClientTest {
40 private JSONObject catalog;
45 * @throws URISyntaxException the URI syntax exception
46 * @throws IOException Signals that an I/O exception has occurred.
49 public void setUp() throws URISyntaxException, IOException {
50 final InputStream asdcCatalogFile = getClass().getClassLoader().getResourceAsStream("catalog.json");
52 final JSONTokener tokener = new JSONTokener(asdcCatalogFile);
54 catalog = new JSONObject(tokener);
60 * @throws AsdcCatalogException the asdc catalog exception
63 public void testResources() throws AsdcCatalogException {
65 runResourceTests(new InMemoryAsdcClient.Builder().catalog(catalog).mapper(new ObjectMapper()).build());
71 * @throws AsdcCatalogException the asdc catalog exception
72 * @throws URISyntaxException the URI syntax exception
75 public void testServices() throws AsdcCatalogException, URISyntaxException {
77 runServiceTests(new InMemoryAsdcClient.Builder().catalog(catalog).build());