44import static org .hamcrest .CoreMatchers .containsString ;
55import static org .hamcrest .CoreMatchers .not ;
66import static org .hamcrest .CoreMatchers .equalTo ;
7+ import static org .hamcrest .CoreMatchers .startsWith ;
78import static org .junit .Assert .assertEquals ;
89import static org .junit .Assert .assertFalse ;
910import static org .junit .Assert .assertNotEquals ;
@@ -1893,7 +1894,7 @@ public void testGenerateNameId() throws URISyntaxException, IOException, Certifi
18931894 public void testGenerateUniqueID () {
18941895 String s1 = Util .generateUniqueID ();
18951896
1896- assertThat (s1 , containsString (Util .UNIQUE_ID_PREFIX ));
1897+ assertThat (s1 , startsWith (Util .UNIQUE_ID_PREFIX ));
18971898 assertTrue (s1 .length () > 40 );
18981899
18991900 String s2 = Util .generateUniqueID ();
@@ -1903,36 +1904,6 @@ public void testGenerateUniqueID() {
19031904 assertNotEquals (s2 , s3 );
19041905 }
19051906
1906- /**
1907- * Tests the uniqid method
1908- *
1909- * @see com.onelogin.saml2.util.Util#uniqid
1910- */
1911- @ Test
1912- public void testUniqid () {
1913- String id_1 = Util .uniqid (null , false );
1914- String id_2 = Util .uniqid (null , false );
1915- assertNotEquals (id_1 , id_2 );
1916-
1917- String id_3 = Util .uniqid (null , true );
1918- String id_4 = Util .uniqid (null , true );
1919- assertNotEquals (id_3 , id_4 );
1920-
1921- assertNotEquals (id_1 , id_3 );
1922- assertNotEquals (id_1 , id_4 );
1923- assertNotEquals (id_2 , id_3 );
1924- assertNotEquals (id_2 , id_4 );
1925-
1926- String id_5 = Util .uniqid (Util .UNIQUE_ID_PREFIX , false );
1927- String id_6 = Util .uniqid (Util .UNIQUE_ID_PREFIX , true );
1928- assertThat (id_5 , containsString (Util .UNIQUE_ID_PREFIX ));
1929- assertThat (id_6 , containsString (Util .UNIQUE_ID_PREFIX ));
1930- assertNotEquals (id_5 , id_6 );
1931-
1932- String id_7 = Util .uniqid ("" , false );
1933- assertNotEquals (id_6 , id_7 );
1934- }
1935-
19361907 /**
19371908 * Tests the parseDuration method
19381909 *
0 commit comments