File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/AndroidClient/client/src/androidTest/java/net/servicestack/client/tests Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 77
88import java .text .SimpleDateFormat ;
99import java .util .Date ;
10+ import java .util .UUID ;
1011
1112public class UtilsTests extends ApplicationTestCase <Application > {
1213 public UtilsTests () {
@@ -27,4 +28,15 @@ public void test_Can_stripSubMillis(){
2728 assertEquals ("2015-03-27T03:41:41.987+00:00" ,Utils .stripSubMillis ("2015-03-27T03:41:41.9873+00:00" ));
2829 assertEquals ("2015-03-27T03:41:41.987+00:00" ,Utils .stripSubMillis ("2015-03-27T03:41:41.987+00:00" ));
2930 }
31+
32+ //https://www.ntosic.net/2015/05/integrating-net-and-java-convert-system-guid-to-java-util-uuid/
33+ public void test_Can_convert_MS_Guid_to_Java_UUID (){
34+ String guidStr = "4E07D932-8D1A-4CE1-9314-7AC7826E8966" ;
35+ String uuidStr = "32D9074E-1A8D-E14C-9314-7AC7826E8966" ;
36+
37+ UUID uuid = Utils .fromGuidString (guidStr );
38+ assertEquals (uuidStr , uuid .toString ().toUpperCase ());
39+
40+ assertEquals (guidStr .replaceAll ("-" ,"" ), Utils .toGuidString (uuid ).toUpperCase ());
41+ }
3042}
You can’t perform that action at this time.
0 commit comments