Search in sources :

Example 1 with DisplayName

use of org.junit.jupiter.api.DisplayName in project nem2-sdk-java by nemtech.

the class AggregateTransactionTest method serialization.

@Test
@DisplayName("Serialization")
void serialization() {
    // Generated at nem2-library-js/test/transactions/RegisterNamespaceTransaction.spec.js
    byte[] expected = new byte[] { (byte) 209, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, (byte) 144, 65, 65, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 85, 0, 0, 0, 85, 0, 0, 0, (byte) 132, 107, 68, 57, 21, 69, 121, (byte) 165, (byte) 144, 59, 20, 89, (byte) 201, (byte) 207, 105, (byte) 203, (byte) 129, 83, (byte) 246, (byte) 208, 17, 10, 122, 14, (byte) 214, 29, (byte) 226, (byte) 154, (byte) 228, (byte) 129, 11, (byte) 242, 3, (byte) 144, 84, 65, (byte) 144, 80, (byte) 185, (byte) 131, 126, (byte) 250, (byte) 180, (byte) 187, (byte) 232, (byte) 164, (byte) 185, (byte) 187, 50, (byte) 216, 18, (byte) 249, (byte) 136, 92, 0, (byte) 216, (byte) 252, 22, 80, (byte) 225, 66, 1, 0, 1, 0, 41, (byte) 207, 95, (byte) 217, 65, (byte) 173, 37, (byte) 213, (byte) 128, (byte) 150, (byte) 152, 0, 0, 0, 0, 0 };
    TransferTransaction transferTx = TransferTransaction.create(new FakeDeadline(), new Address("SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC", NetworkType.MIJIN_TEST), Collections.singletonList(new Mosaic(XEM.MOSAICID, BigInteger.valueOf(10000000))), PlainMessage.Empty, NetworkType.MIJIN_TEST);
    AggregateTransaction aggregateTx = AggregateTransaction.createComplete(new FakeDeadline(), Collections.singletonList(transferTx.toAggregate(new PublicAccount("846B4439154579A5903B1459C9CF69CB8153F6D0110A7A0ED61DE29AE4810BF2", NetworkType.MIJIN_TEST))), NetworkType.MIJIN_TEST);
    byte[] actual = aggregateTx.generateBytes();
    assertArrayEquals(expected, actual);
}
Also used : Address(io.nem.sdk.model.account.Address) PublicAccount(io.nem.sdk.model.account.PublicAccount) Mosaic(io.nem.sdk.model.mosaic.Mosaic) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 2 with DisplayName

use of org.junit.jupiter.api.DisplayName in project nem2-sdk-java by nemtech.

the class MosaicSupplyChangeTransactionTest method serialization.

@Test
@DisplayName("Serialization")
void serialization() {
    // Generated at nem2-library-js/test/transactions/MosaicSupplyChangeTransaction.spec.js
    byte[] expected = new byte[] { (byte) 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, (byte) 144, 77, 66, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, (byte) 136, 105, 116, 110, (byte) 155, 26, 112, 87, 1, 10, 0, 0, 0, 0, 0, 0, 0 };
    MosaicSupplyChangeTransaction mosaicSupplyChangeTransaction = MosaicSupplyChangeTransaction.create(new FakeDeadline(), new MosaicId(new BigInteger("6300565133566699912")), MosaicSupplyType.INCREASE, BigInteger.valueOf(10), NetworkType.MIJIN_TEST);
    byte[] actual = mosaicSupplyChangeTransaction.generateBytes();
    assertArrayEquals(expected, actual);
}
Also used : MosaicId(io.nem.sdk.model.mosaic.MosaicId) BigInteger(java.math.BigInteger) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 3 with DisplayName

use of org.junit.jupiter.api.DisplayName in project nem2-sdk-java by nemtech.

the class TransferTransactionTest method toAggregate.

@Test
@DisplayName("To aggregate")
void toAggregate() {
    byte[] expected = new byte[] { 85, 0, 0, 0, -102, 73, 54, 100, 6, -84, -87, 82, -72, -117, -83, -11, -15, -23, -66, 108, -28, -106, -127, 65, 3, 90, 96, -66, 80, 50, 115, -22, 101, 69, 107, 36, 3, -112, 84, 65, -112, -24, -2, -67, 103, 29, -44, 27, -18, -108, -20, 59, -91, -125, 28, -74, 8, -93, 18, -62, -14, 3, -70, -124, -84, 1, 0, 1, 0, 103, 43, 0, 0, -50, 86, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0 };
    TransferTransaction transferTransaction = TransferTransaction.create(new FakeDeadline(), new Address("SDUP5PLHDXKBX3UU5Q52LAY4WYEKGEWC6IB3VBFM", NetworkType.MIJIN_TEST), Arrays.asList(new Mosaic(new MosaicId(new BigInteger("95442763262823")), BigInteger.valueOf(100))), PlainMessage.Empty, NetworkType.MIJIN_TEST);
    byte[] actual = transferTransaction.toAggregate(new PublicAccount("9A49366406ACA952B88BADF5F1E9BE6CE4968141035A60BE503273EA65456B24", NetworkType.MIJIN_TEST)).toAggregateTransactionBytes();
    assertArrayEquals(expected, actual);
}
Also used : Address(io.nem.sdk.model.account.Address) MosaicId(io.nem.sdk.model.mosaic.MosaicId) PublicAccount(io.nem.sdk.model.account.PublicAccount) BigInteger(java.math.BigInteger) Mosaic(io.nem.sdk.model.mosaic.Mosaic) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Example 4 with DisplayName

use of org.junit.jupiter.api.DisplayName in project winery by eclipse.

the class YamlWriterTest method roundTripTest.

@DisplayName("Test read and write round trip")
@ParameterizedTest(name = "{index} name=''{0}''")
@MethodSource("getYamlFiles")
public void roundTripTest(Path fileName) throws Exception {
    TServiceTemplate serviceTemplate = this.getYamlServiceTemplate(fileName);
    writeYamlServiceTemplate(serviceTemplate, temporaryFolder.resolve(fileName));
    TServiceTemplate out = this.getYamlServiceTemplate(fileName, temporaryFolder);
    Assertions.assertEquals(serviceTemplate, out);
}
Also used : TServiceTemplate(org.eclipse.winery.model.tosca.yaml.TServiceTemplate) DisplayName(org.junit.jupiter.api.DisplayName) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Example 5 with DisplayName

use of org.junit.jupiter.api.DisplayName in project nem2-sdk-java by nemtech.

the class MosaicDefinitionTransactionTest method serialization.

@Test
@DisplayName("Serialization")
void serialization() {
    byte[] expected = new byte[] { (byte) 156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, (byte) 144, 77, 65, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, (byte) 155, (byte) 138, 22, 28, (byte) 245, 9, 35, (byte) 144, 21, (byte) 153, 17, (byte) 174, (byte) 167, 46, (byte) 189, 60, 7, 1, 7, 4, 109, 111, 115, 97, 105, 99, 115, 2, 16, 39, 0, 0, 0, 0, 0, 0 };
    MosaicDefinitionTransaction mosaicDefinitionTransaction = MosaicDefinitionTransaction.create(new FakeDeadline(), "mosaics", "sname", new MosaicProperties(true, true, true, 4, BigInteger.valueOf(10000)), NetworkType.MIJIN_TEST);
    byte[] actual = mosaicDefinitionTransaction.generateBytes();
    assertArrayEquals(expected, actual);
}
Also used : MosaicProperties(io.nem.sdk.model.mosaic.MosaicProperties) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Aggregations

DisplayName (org.junit.jupiter.api.DisplayName)8 Test (org.junit.jupiter.api.Test)6 BigInteger (java.math.BigInteger)4 Address (io.nem.sdk.model.account.Address)3 Mosaic (io.nem.sdk.model.mosaic.Mosaic)3 MosaicId (io.nem.sdk.model.mosaic.MosaicId)3 PublicAccount (io.nem.sdk.model.account.PublicAccount)2 TServiceTemplate (org.eclipse.winery.model.tosca.yaml.TServiceTemplate)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 MosaicProperties (io.nem.sdk.model.mosaic.MosaicProperties)1 NamespaceId (io.nem.sdk.model.namespace.NamespaceId)1 Path (java.nio.file.Path)1 MethodSource (org.junit.jupiter.params.provider.MethodSource)1 ValueSource (org.junit.jupiter.params.provider.ValueSource)1