org.assertj.core.api.AbstractByteArrayAssert.isNotEqualTo()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(29)

本文整理了Java中org.assertj.core.api.AbstractByteArrayAssert.isNotEqualTo()方法的一些代码示例,展示了AbstractByteArrayAssert.isNotEqualTo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractByteArrayAssert.isNotEqualTo()方法的具体详情如下:
包路径:org.assertj.core.api.AbstractByteArrayAssert
类名称:AbstractByteArrayAssert
方法名:isNotEqualTo

AbstractByteArrayAssert.isNotEqualTo介绍

暂无

代码示例

代码示例来源:origin: gocd/gocd

@Test
public void shouldGenerateDifferentCipherTextEveryTime() throws NoSuchAlgorithmException {
  ProductionIVProvider ivProvider = new ProductionIVProvider();
  byte[] iv1 = ivProvider.createIV();
  byte[] iv2 = ivProvider.createIV();
  assertThat(iv1).isNotEqualTo(iv2);
}

代码示例来源:origin: square/wire

assertThat(v1).isNotEqualTo(v1Simple);
assertThat(v1.hashCode()).isNotEqualTo(v1Simple.hashCode());
assertThat(v1Adapter.encode(v1)).isNotEqualTo(v1Adapter.encode(v1Simple));

代码示例来源:origin: Nike-Inc/riposte

@Test
public void verify_compression_helper_methods_work_as_expected() {
  // given
  String orig = UUID.randomUUID().toString();
  // when
  byte[] gzipped = gzipPayload(orig);
  String ungzipped = ungzipPayload(gzipped);
  byte[] deflated = deflatePayload(orig);
  String inflated = inflatePayload(deflated);
  // then
  assertThat(gzipped).isNotEqualTo(orig.getBytes(UTF_8));
  assertThat(deflated).isNotEqualTo(orig.getBytes(UTF_8));
  assertThat(ungzipped).isEqualTo(orig);
  assertThat(inflated).isEqualTo(orig);
  assertThat(gzipped).isNotEqualTo(deflated);
}

代码示例来源:origin: org.apache.james/blob-objectstorage

@Test
void aesCodecShouldEncryptPayloadContentWhenWriting() throws Exception {
  Payload payload = codec().write(expected());
  byte[] bytes = IOUtils.toByteArray(payload.openStream());
  // authenticated encryption uses a random salt for the authentication
  // header all we can say for sure is that the output is not the same as
  // the input.
  assertThat(bytes).isNotEqualTo(SOME_BYTES);
}

代码示例来源:origin: org.apache.james/blob-objectstorage

@Test
  void encryptionWithCustomPayloadCodeCannotBeReadFromUnencryptedDAO() throws Exception {
    ObjectStorageBlobsDAO encryptedDao = ObjectStorageBlobsDAO
      .builder(testConfig)
      .container(containerName)
      .blobIdFactory(blobIdFactory())
      .payloadCodec(new AESPayloadCodec(CRYPTO_CONFIG))
      .build();
    byte[] bytes = "James is the best!".getBytes(StandardCharsets.UTF_8);
    BlobId blobId = encryptedDao.save(bytes).join();

    InputStream encryptedIs = testee.read(blobId);
    assertThat(encryptedIs).isNotNull();
    byte[] encryptedBytes = IOUtils.toByteArray(encryptedIs);
    assertThat(encryptedBytes).isNotEqualTo(bytes);

    InputStream clearTextIs = encryptedDao.read(blobId);
    assertThat(clearTextIs).hasSameContentAs(new ByteArrayInputStream(bytes));
  }
}

相关文章