Update eclipse.persistence and eelf.core in aai-common
[aai/aai-common.git] / aai-core / src / test / java / org / onap / aai / restcore / JettyObfuscationConversionCommandLineUtilTest.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017-2018 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
10  *
11  *    http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 package org.onap.aai.restcore;
22
23 import org.apache.commons.io.IOUtils;
24 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
25 import org.apache.tinkerpop.gremlin.structure.Graph;
26 import org.apache.tinkerpop.gremlin.structure.Vertex;
27 import org.janusgraph.core.JanusGraphFactory;
28 import org.junit.*;
29 import org.junit.rules.ExpectedException;
30 import org.junit.runner.RunWith;
31 import org.junit.runners.Parameterized;
32 import org.onap.aai.AAISetup;
33 import org.onap.aai.db.DbMethHelper;
34 import org.onap.aai.exceptions.AAIException;
35 import org.onap.aai.introspection.Introspector;
36 import org.onap.aai.introspection.Loader;
37 import org.onap.aai.introspection.ModelType;
38 import org.onap.aai.parsers.exceptions.AmbiguousMapAAIException;
39 import org.onap.aai.serialization.db.DBSerializer;
40 import org.onap.aai.serialization.db.EdgeSerializer;
41 import org.onap.aai.serialization.engines.JanusGraphDBEngine;
42 import org.onap.aai.serialization.engines.QueryStyle;
43 import org.onap.aai.serialization.engines.TransactionalGraphEngine;
44 import org.onap.aai.setup.SchemaVersion;
45 import org.springframework.beans.factory.annotation.Autowired;
46 import org.springframework.test.annotation.DirtiesContext;
47
48 import java.io.FileInputStream;
49 import java.io.IOException;
50 import java.text.ParseException;
51 import java.util.*;
52
53 import static org.mockito.Mockito.spy;
54 import static org.mockito.Mockito.when;
55
56 public class JettyObfuscationConversionCommandLineUtilTest extends AAISetup {
57     public static JettyObfuscationConversionCommandLineUtil jettyObfuscationConversionCommandLineUtil;
58
59     @Test
60     public void testMainObfuscation() {
61         String[] args = {"-e", "[thisStringToObfuscate]"};
62         jettyObfuscationConversionCommandLineUtil.main(args);
63         Assert.assertTrue(true);    // No exception was encountered
64     }
65
66     @Test
67     public void testMainDeobfuscation() {
68         String[] args = {"-d", "OBF:1pj11w261wmr1t3b1vgv1s9r1z7i1vuz1tae1qji1vg71mdb1vgn1qhs1ta01vub1z7k1sbj1vfz1t2v1wnf1w1c1pj5"};
69         jettyObfuscationConversionCommandLineUtil.main(args);
70         Assert.assertTrue(true);    // No exception was encountered
71     }
72
73     @Test
74     public void testMain_failedParseInput() {
75         String[] args = {"-e [thisStringToObfuscate]"};
76         jettyObfuscationConversionCommandLineUtil.main(args);
77         Assert.assertTrue(true);    // No exception was encountered
78     }
79 }