* ============LICENSE_START=======================================================
* ONAP : APPC
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 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.
- *
* ============LICENSE_END=========================================================
*/
import java.nio.charset.Charset;
import org.apache.commons.io.IOUtils;
import org.json.JSONObject;
-import org.junit.Test;
import org.junit.Ignore;
+import org.junit.Test;
import org.mockito.Mockito;
import org.opendaylight.yang.gen.v1.org.onap.appc.artifacthandler.rev170321.UploadartifactInput;
import org.opendaylight.yang.gen.v1.org.onap.appc.artifacthandler.rev170321.UploadartifactInputBuilder;
ahprovider.processTemplate(obj.toString());
}
- @Ignore
+ // @Ignore
@Test(expected = Exception.class)
public void testcreateDummyRequestData() throws Exception {
String artifact_conetent = IOUtils.toString(ArtifactHandlerProviderUtilTest.class.getClassLoader()
obj.put("artifact-version", "0.01");
obj.put("artifact-contents", artifact_conetent);
ArtifactHandlerProviderUtil ahprovider = new ArtifactHandlerProviderUtil();
- ahprovider.createDummyRequestData();
+ String requestInfo = ahprovider.createDummyRequestData();
}
@Test
assertEquals("Test String is ''test''", ahprovider.escapeSql(testStr));
}
+ @Test
+ public void testGetRandom() throws Exception {
+ ArtifactHandlerProviderUtil ahprovider = new ArtifactHandlerProviderUtil();
+ Whitebox.invokeMethod(ahprovider, "getRandom");
+ assertTrue(true);
+ }
+
@Test
public void testEscapeUtils() throws Exception {
String str = "The Test string is 'test'";
builder.setRequestInformation(mockRequestInformation);
UploadartifactInput uploadArtifactInput = builder.build();
Whitebox.setInternalState(ahprovider, "templateData", uploadArtifactInput);
- assertTrue(ahprovider.createDummyRequestData().startsWith("{\"input\": {\"document-parameters\":{\"service-uuid\":\"TLSUUIDREQUEST ID\""));
+ assertTrue(ahprovider.createDummyRequestData()
+ .startsWith("{\"input\": {\"document-parameters\":{\"service-uuid\":\"TLSUUIDREQUEST ID\""));
}
@Test
ahProvider.createRequestData());
}
}
-