Search in sources :

Example 1 with Bytes

use of com.palantir.conjure.java.lib.Bytes in project conjure-java by palantir.

the class WireFormatTests method testAliasTypesEqualWhenInnerTypeEqual.

@Test
public void testAliasTypesEqualWhenInnerTypeEqual() throws Exception {
    assertThat(StringAliasExample.of("a")).isEqualTo(StringAliasExample.of("a"));
    assertThat(IntegerAliasExample.of(103)).isEqualTo(IntegerAliasExample.of(103));
    assertThat(DoubleAliasExample.of(10.3)).isEqualTo(DoubleAliasExample.of(10.3));
    Bytes bytes = Bytes.from(new byte[] { 0, 1, 2 });
    assertThat(BinaryAliasExample.of(bytes)).isEqualTo(BinaryAliasExample.of(bytes));
}
Also used : Bytes(com.palantir.conjure.java.lib.Bytes) Test(org.junit.jupiter.api.Test)

Example 2 with Bytes

use of com.palantir.conjure.java.lib.Bytes in project conjure-java by palantir.

the class WireFormatTests method testAliasTypesHashCodeEqualWhenInnerTypeEqual.

@Test
public void testAliasTypesHashCodeEqualWhenInnerTypeEqual() throws Exception {
    assertThat(StringAliasExample.of("a").hashCode()).isEqualTo(StringAliasExample.of("a").hashCode());
    assertThat(IntegerAliasExample.of(103).hashCode()).isEqualTo(IntegerAliasExample.of(103).hashCode());
    assertThat(DoubleAliasExample.of(10.3).hashCode()).isEqualTo(DoubleAliasExample.of(10.3).hashCode());
    Bytes bytes = Bytes.from(new byte[] { 0, 1, 2 });
    assertThat(BinaryAliasExample.of(bytes).hashCode()).isEqualTo(BinaryAliasExample.of(bytes).hashCode());
}
Also used : Bytes(com.palantir.conjure.java.lib.Bytes) Test(org.junit.jupiter.api.Test)

Aggregations

Bytes (com.palantir.conjure.java.lib.Bytes)2 Test (org.junit.jupiter.api.Test)2