summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKiran Kamineni <kiran.k.kamineni@intel.com>2018-03-14 09:35:32 -0700
committerKiran Kamineni <kiran.k.kamineni@intel.com>2018-03-14 11:24:25 -0700
commit75dd5474ec6a2a1c4fbf513e82ba6f4ae08f85f6 (patch)
tree95562140262910c45e559fbb85c98903cc680b08
parent048ab0daafdb754dbfefbce0e4e01ca9e5a48a7b (diff)
Updated with variety of values in client example
Added a few different values in map that are of different datatypes Sorted the import statements and grouped by function Issue-ID: AAF-98 Change-Id: Ibe9f3188b1373c10275ea4aa4817eca789680b91 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
-rw-r--r--sms-client/src/java/example/SmsClientExample.java30
1 files changed, 18 insertions, 12 deletions
diff --git a/sms-client/src/java/example/SmsClientExample.java b/sms-client/src/java/example/SmsClientExample.java
index b82d6d1..7bbaa90 100644
--- a/sms-client/src/java/example/SmsClientExample.java
+++ b/sms-client/src/java/example/SmsClientExample.java
@@ -14,20 +14,22 @@
* limitations under the License.
*/
-import java.security.Provider;
-import java.security.Security;
-import java.security.KeyStore;
-import java.security.SecureRandom;
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.TrustManagerFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.SSLSessionContext;
import java.io.FileInputStream;
+import java.lang.Boolean;
+import java.lang.Integer;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
-import java.util.Map;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSessionContext;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManagerFactory;
+import java.security.KeyStore;
+import java.security.Provider;
+import java.security.SecureRandom;
+import java.security.Security;
import java.util.HashMap;
+import java.util.Map;
import org.onap.aaf.sms.SmsClient;
import org.onap.aaf.sms.SmsResponse;
@@ -80,7 +82,11 @@ public class SmsClientExample {
}
Map<String, Object> m2 = new HashMap<String, Object>();
m2.put("username", "dbuser");
- SmsResponse resp3 = sms.storeSecret("onap.new.test.sms0","user", m2);
+ m2.put("isadmin", new Boolean(true));
+ m2.put("age", new Integer(40));
+ m2.put("secretkey", "asjdhkuhioeukadfjsadnfkjhsdukfhaskdjhfasdf");
+ m2.put("token", "2139084553458973452349230849234234908234342");
+ SmsResponse resp3 = sms.storeSecret("onap.new.test.sms0","credentials", m2);
if ( resp3.getSuccess() ) {
System.out.println(resp3.getResponse());
System.out.println(resp3.getResponseCode());
@@ -95,7 +101,7 @@ public class SmsClientExample {
System.out.println(resp5.getResponse());
System.out.println(resp5.getResponseCode());
}
- SmsResponse resp6= sms.getSecret("onap.new.test.sms0", "user");
+ SmsResponse resp6= sms.getSecret("onap.new.test.sms0", "credentials");
if ( resp6.getSuccess() ) {
System.out.println(resp6.getResponse());
System.out.println(resp6.getResponseCode());