-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging' into new_view_module
- Loading branch information
Showing
5 changed files
with
66 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
sdk-java/src/test/java/ly/count/sdk/java/internal/ScenarioUtilsTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package ly.count.sdk.java.internal; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.JUnit4; | ||
|
||
@RunWith(JUnit4.class) | ||
public class ScenarioUtilsTests { | ||
|
||
/** | ||
* "safeRandomVal" | ||
* ### 001_validatingIDGenerator | ||
* <p> | ||
* testing the ID generator function that is used for events and views | ||
* <p> | ||
* Generate 2 values | ||
* <p> | ||
* they should be different. | ||
* They should be 21 chars long. | ||
* They should contain on base64 characters. first 8 one is base64 string and last 13 one is timestamp | ||
* | ||
* @throws NumberFormatException for parsing part 2 | ||
*/ | ||
@Test | ||
public void _001_validatingIDGenerator() throws NumberFormatException { | ||
String val1 = Utils.safeRandomVal(); | ||
String val2 = Utils.safeRandomVal(); | ||
|
||
Assert.assertNotEquals(val2, val1); | ||
|
||
TestUtils.validateSafeRandomVal(val1); | ||
TestUtils.validateSafeRandomVal(val2); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters