-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Protection against Epoch Transition null values received from Koi…
…os Instances. Bump version to 1.16.3
- Loading branch information
Showing
5 changed files
with
45 additions
and
31 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
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 |
---|---|---|
@@ -1,18 +1,34 @@ | ||
package rest.koios.client.utils; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.lang.reflect.Constructor; | ||
import java.lang.reflect.InvocationTargetException; | ||
import java.lang.reflect.Modifier; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class Bech32UtilTest { | ||
|
||
@Test | ||
void invalidCharsTest() { | ||
Assertions.assertFalse(Bech32Util.hasValidChars(null)); | ||
assertFalse(Bech32Util.hasValidChars(null)); | ||
|
||
Assertions.assertFalse(Bech32Util.hasValidChars("")); | ||
assertFalse(Bech32Util.hasValidChars("")); | ||
|
||
Assertions.assertFalse(Bech32Util.hasValidChars("IQoJb3JpZ2luX2VjEJP//////////wEaCXVzLWVhc3QtMSJGMEQCIFEdcXP1FbfLBZSp1OCWP6eB6pofyWx/plHVZe4BSuUEAiAKVZYe5340wvB5uDv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AGOpkBeHgMzPDkljTJ244SO/vk1BGNNBrJeBZKLLTPsH/bynI2QSQlZcq8zreLh4GoalS+0QSRcsvPhCainLeZkxOqsK1+kfUBJpe3TW6lGLaqc8DIqUBMkhCwCbSDKWMe/o2RmlzLKZSSeJ/gABoNulUXxPpkfIBemCYi377DD5szO6dWAcLdny1FK2cZqVtRNDwh7XLpunvhMsiA")); | ||
|
||
Assertions.assertFalse(Bech32Util.hasValidChars("pooL1rcsezjrma577f06yp40lsz76uvwh7gne35afx3zrq2ktx50f8t8")); | ||
assertFalse(Bech32Util.hasValidChars("pooL1rcsezjrma577f06yp40lsz76uvwh7gne35afx3zrq2ktx50f8t8")); | ||
} | ||
|
||
@Test | ||
void testConstructorIsPrivate() throws NoSuchMethodException { | ||
Constructor<Bech32Util> constructor = Bech32Util.class.getDeclaredConstructor(); | ||
assertTrue(Modifier.isPrivate(constructor.getModifiers())); | ||
constructor.setAccessible(true); | ||
InvocationTargetException exception = assertThrows(InvocationTargetException.class, constructor::newInstance); | ||
assertInstanceOf(InvocationTargetException.class, exception); | ||
assertInstanceOf(IllegalStateException.class, exception.getCause()); | ||
assertEquals("Utility Class", exception.getCause().getMessage()); | ||
} | ||
} |