From 75dd5474ec6a2a1c4fbf513e82ba6f4ae08f85f6 Mon Sep 17 00:00:00 2001 From: Kiran Kamineni Date: Wed, 14 Mar 2018 09:35:32 -0700 Subject: [PATCH] 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 --- sms-client/src/java/example/SmsClientExample.java | 30 ++++++++++++++--------- 1 file 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 m2 = new HashMap(); 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()); -- 2.16.6