-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: update tests in com.itangcent.http (#500)
- Loading branch information
Showing
10 changed files
with
930 additions
and
424 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
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
21 changes: 21 additions & 0 deletions
21
common-api/src/test/kotlin/com/itangcent/common/http/EntityUtilsTest.kt
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,21 @@ | ||
package com.itangcent.common.http | ||
|
||
import org.junit.jupiter.api.Assertions.assertNotNull | ||
import org.junit.jupiter.api.Assertions.assertTrue | ||
import org.junit.jupiter.api.Test | ||
|
||
internal class EntityUtilsTest { | ||
|
||
@Test | ||
fun generateBoundary() { | ||
val set = HashSet<String>() | ||
for (i in 0..100) { | ||
val boundary = EntityUtils.generateBoundary() | ||
assertNotNull(boundary) | ||
//length of boundary should be a random size from 30 to 40 | ||
assertTrue(boundary.length >= 30) | ||
assertTrue(boundary.length <= 40) | ||
assertTrue(set.add(boundary)) | ||
} | ||
} | ||
} |
Oops, something went wrong.