-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into doc/RA-37-main-page
- Loading branch information
Showing
18 changed files
with
227 additions
and
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,6 @@ public String getValue() { | |
|
||
@Override | ||
public String toString() { | ||
return String.valueOf(value); | ||
return value; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -28,6 +28,6 @@ public String getLabel() { | |
|
||
@Override | ||
public String toString() { | ||
return String.valueOf(label); | ||
return label; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -2,8 +2,5 @@ | |
|
||
public enum NetworkId { | ||
TESTNET, | ||
MAINNET; | ||
|
||
private NetworkId() { | ||
} | ||
MAINNET | ||
} |
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 |
---|---|---|
|
@@ -28,6 +28,6 @@ public String getValue() { | |
|
||
@Override | ||
public String toString() { | ||
return String.valueOf(value); | ||
return value; | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
api/src/test/java/org/cardanofoundation/rosetta/common/enumeration/AddressTypeTest.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,22 @@ | ||
package org.cardanofoundation.rosetta.common.enumeration; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNull; | ||
|
||
class AddressTypeTest { | ||
|
||
final AddressType[] addressTypes = AddressType.values(); | ||
|
||
@Test | ||
void findByValue() { | ||
for (AddressType addressType : addressTypes) { | ||
AddressType actual = AddressType.findByValue(addressType.getValue()); | ||
assertEquals(addressType, actual); | ||
// check toString() method to return the value | ||
assertEquals(addressType.getValue(), actual.toString()); | ||
} | ||
assertNull(AddressType.findByValue("Invalid")); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...c/test/java/org/cardanofoundation/rosetta/common/enumeration/CatalystDataIndexesTest.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,21 @@ | ||
package org.cardanofoundation.rosetta.common.enumeration; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNull; | ||
|
||
class CatalystDataIndexesTest { | ||
|
||
final CatalystDataIndexes[] catalystDataIndexes = CatalystDataIndexes.values(); | ||
|
||
@Test | ||
void findByValue() { | ||
for (CatalystDataIndexes catalystDataIndex : catalystDataIndexes) { | ||
CatalystDataIndexes actual = CatalystDataIndexes.findByValue(catalystDataIndex.getValue()); | ||
assertEquals(catalystDataIndex, actual); | ||
assertEquals(String.valueOf(catalystDataIndex.getValue()), actual.toString()); | ||
} | ||
assertNull(CatalystDataIndexes.findByValue(0L)); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
api/src/test/java/org/cardanofoundation/rosetta/common/enumeration/CatalystLabelsTest.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,21 @@ | ||
package org.cardanofoundation.rosetta.common.enumeration; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNull; | ||
|
||
class CatalystLabelsTest { | ||
|
||
final CatalystLabels[] catalystLabels = CatalystLabels.values(); | ||
|
||
@Test | ||
void findByValue() { | ||
for (CatalystLabels catalystLabel : catalystLabels) { | ||
CatalystLabels actual = CatalystLabels.findByValue(catalystLabel.getLabel()); | ||
assertEquals(catalystLabel, actual); | ||
assertEquals(catalystLabel.getLabel(), actual.toString()); | ||
} | ||
assertNull(CatalystLabels.findByValue("Invalid")); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
api/src/test/java/org/cardanofoundation/rosetta/common/enumeration/NetworkEnumTest.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,30 @@ | ||
package org.cardanofoundation.rosetta.common.enumeration; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNull; | ||
|
||
class NetworkEnumTest { | ||
|
||
final NetworkEnum[] networkEnums = NetworkEnum.values(); | ||
|
||
@Test | ||
void fromValue() { | ||
for (NetworkEnum networkEnum : networkEnums) { | ||
NetworkEnum actual = NetworkEnum.fromValue(networkEnum.getValue()); | ||
assertEquals(networkEnum, actual); | ||
} | ||
assertNull(NetworkEnum.fromValue("Invalid")); | ||
} | ||
|
||
@Test | ||
void fromProtocolMagic() { | ||
for (NetworkEnum networkEnum : networkEnums) { | ||
NetworkEnum actual = NetworkEnum.fromProtocolMagic( | ||
networkEnum.getNetwork().getProtocolMagic()); | ||
assertEquals(networkEnum, actual); | ||
} | ||
assertNull(NetworkEnum.fromProtocolMagic(0L)); | ||
} | ||
} |
Oops, something went wrong.