* ============LICENSE_START=======================================================
* ONAP : APPC
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-18 AT&T Intellectual Property. All rights reserved.
* =============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
HTTPSProperties.PROPERTY_HTTPS_PROPERTIES,
new HTTPSProperties(getHostnameVerifier(), sslContext));
client = createClient(defaultClientConfig);
- client.addFilter(new HTTPBasicAuthFilter(transaction.getId(), transaction.getPswd()));
+ client.addFilter(new HTTPBasicAuthFilter(transaction.getuId(), transaction.getPswd()));
WebResource webResource = client.resource(new URI(transaction.getExecutionEndPoint()));
webResource.setProperty("Content-Type", "application/json;charset=UTF-8");
--- /dev/null
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP : APPC\r
+ * ================================================================================\r
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ *\r
+ * * ============LICENSE_END=========================================================\r
+ */\r
+\r
+package org.onap.appc.flow.controller.node;\r
+\r
+import static org.junit.Assert.assertEquals;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import org.junit.Test;\r
+import org.onap.appc.flow.controller.data.Transaction;\r
+import org.onap.appc.flow.controller.data.Transactions;\r
+\r
+import com.fasterxml.jackson.core.JsonProcessingException;\r
+import com.fasterxml.jackson.databind.ObjectMapper;\r
+\r
+/*\r
+ * Adding this test case to ensure that JSON mapping works as expected.\r
+ * Add or modify test case if changes are made to class attributes.\r
+ *\r
+*/\r
+public class MapperTest {\r
+\r
+ @Test\r
+ public void testsIfJsonGenerationisValid() throws JsonProcessingException {\r
+\r
+ Transaction t = new Transaction();\r
+ Transactions transactions = new Transactions();\r
+ t.setAction("testAction");\r
+ t.setTransactionId(100);\r
+ t.setActionLevel("testActionLevel");\r
+ t.setExecutionRPC("testMethod");\r
+ List<Transaction> tList = new ArrayList<Transaction>();\r
+ tList.add(t);\r
+ transactions.setTransactions(tList);\r
+ Transactions trans = transactions;\r
+ ObjectMapper mapper = new ObjectMapper();\r
+ String flowSequence = mapper.writeValueAsString(trans);\r
+ String compareString = "{\"transactions\":[{\"executionType\":null,\"uId\":null,\"statusCode\":null,\"pswd\":null,"\r
+ + "\"executionEndPoint\":null,\"executionModule\":null,\"executionRPC\":\"testMethod\","\r
+ + "\"status\":\"PENDING\",\"transaction-id\":100,\"action\":\"testAction\","\r
+ + "\"action-level\":\"testActionLevel\",\"action-identifier\":null,"\r
+ + "\"parameters\":null,\"state\":null,\"precheck\":null,\"payload\":null,\"responses\":null}]}";\r
+ assertEquals(flowSequence, compareString);\r
+\r
+ }\r
+\r
+}\r
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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=========================================================
+ */
+
package org.onap.appc.flow.controller.node;
import static org.mockito.Mockito.mock;
Assert.assertEquals(INPUT_REQUEST_ACTION, transaction.getAction());
Assert.assertEquals("input-ra-type", transaction.getExecutionRPC());
Assert.assertEquals("some uri", transaction.getExecutionEndPoint());
- Assert.assertEquals("rest-user", transaction.getId());
+ Assert.assertEquals("rest-user", transaction.getuId());
Assert.assertEquals("rest-pass", transaction.getPswd());
}
-}
\ No newline at end of file
+}