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

x33g5p2x  于10个月前 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(40)

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

AbstractByteArrayAssert.isNotEmpty介绍

暂无

代码示例

代码示例来源:origin: SonarSource/sonarqube

@Test
public void getSecureMungedAddress() {
 byte[] address = MacAddressProvider.getSecureMungedAddress();
 assertThat(address).isNotEmpty();
 assertThat(address).hasSize(6);
}

代码示例来源:origin: SonarSource/sonarqube

@Test
 public void constructDummyMulticastAddress() {
  byte[] address = MacAddressProvider.constructDummyMulticastAddress();
  assertThat(address).isNotEmpty();
  assertThat(address).hasSize(6);
 }
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void select() {
 dbTester.prepareDbUnit(getClass(), "shared.xml");
 FileSourceDto fileSourceDto = underTest.selectByFileUuid(dbSession, "FILE1_UUID");
 assertThat(fileSourceDto.getBinaryData()).isNotEmpty();
 assertThat(fileSourceDto.getDataHash()).isEqualTo("hash");
 assertThat(fileSourceDto.getProjectUuid()).isEqualTo("PRJ_UUID");
 assertThat(fileSourceDto.getFileUuid()).isEqualTo("FILE1_UUID");
 assertThat(fileSourceDto.getCreatedAt()).isEqualTo(1500000000000L);
 assertThat(fileSourceDto.getUpdatedAt()).isEqualTo(1500000000000L);
 assertThat(fileSourceDto.getRevision()).isEqualTo("123456789");
 assertThat(fileSourceDto.getLineHashesVersion()).isEqualTo(0);
}

代码示例来源:origin: apache/geode

@Test
public void dataSerializes() throws Exception {
 EvictionAttributesImpl evictionAttributes = new EvictionAttributesImpl();
 byte[] bytes = BlobHelper.serializeToBlob(evictionAttributes);
 assertThat(bytes).isNotNull().isNotEmpty();
 assertThat(BlobHelper.deserializeBlob(bytes)).isNotSameAs(evictionAttributes)
   .isInstanceOf(EvictionAttributesImpl.class);
}

代码示例来源:origin: apache/geode

@Test
public void dataSerializes() throws Exception {
 PartitionRegionConfig config = new PartitionRegionConfig(prId, path, partitionAttributes, scope,
   evictionAttributes, regionIdleTimeout, regionTimeToLive, entryIdleTimeout, entryTimeToLive,
   gatewaySenderIds);
 byte[] bytes = BlobHelper.serializeToBlob(config);
 assertThat(bytes).isNotNull().isNotEmpty();
 assertThat(BlobHelper.deserializeBlob(bytes)).isNotSameAs(config)
   .isInstanceOf(PartitionRegionConfig.class);
}

代码示例来源:origin: apache/geode

@Test
 public void serializes() throws Exception {
  EvictionAttributesImpl evictionAttributes = new EvictionAttributesImpl();
  byte[] bytes = SerializationUtils.serialize(evictionAttributes);
  assertThat(bytes).isNotNull().isNotEmpty();
  assertThat((EvictionAttributesImpl) SerializationUtils.deserialize(bytes))
    .isNotSameAs(evictionAttributes)
    .isInstanceOf(EvictionAttributesImpl.class);
 }
}

代码示例来源:origin: apache/geode

@Ignore("GEODE-4812")
 @Test
 public void serializes() throws Exception {
  PartitionRegionConfig config = new PartitionRegionConfig();
  byte[] bytes = SerializationUtils.serialize(config);
  assertThat(bytes).isNotNull().isNotEmpty();
  assertThat((PartitionRegionConfig) SerializationUtils.deserialize(bytes)).isNotSameAs(config)
    .isInstanceOf(PartitionRegionConfig.class);
 }
}

代码示例来源:origin: SonarSource/sonarqube

@Test
public void persist_sources() {
 List<String> lineHashes = Arrays.asList("137f72c3708c6bd0de00a0e5a69c699b", "e6251bcf1a7dc3ba5e7933e325bbe605");
 String sourceHash = "ee5a58024a155466b43bc559d953e018";
 DbFileSources.Data fileSourceData = DbFileSources.Data.newBuilder()
  .addAllLines(Arrays.asList(
   DbFileSources.Line.newBuilder().setSource("line1").setLine(1).build(),
   DbFileSources.Line.newBuilder().setSource("line2").setLine(2).build()))
  .build();
 when(fileSourceDataComputer.compute(fileComponent().build(), fileSourceDataWarnings))
  .thenReturn(new FileSourceDataComputer.Data(fileSourceData, lineHashes, sourceHash, null));
 underTest.execute(new TestComputationStepContext());
 assertThat(dbTester.countRowsOfTable("file_sources")).isEqualTo(1);
 FileSourceDto fileSourceDto = dbClient.fileSourceDao().selectByFileUuid(session, FILE1_UUID);
 assertThat(fileSourceDto.getProjectUuid()).isEqualTo(PROJECT_UUID);
 assertThat(fileSourceDto.getFileUuid()).isEqualTo(FILE1_UUID);
 assertThat(fileSourceDto.getBinaryData()).isNotEmpty();
 assertThat(fileSourceDto.getDataHash()).isNotEmpty();
 assertThat(fileSourceDto.getLineHashesVersion()).isEqualTo(LineHashVersion.WITHOUT_SIGNIFICANT_CODE.getDbValue());
 assertThat(fileSourceDto.getLineHashes()).isNotEmpty();
 assertThat(fileSourceDto.getCreatedAt()).isEqualTo(NOW);
 assertThat(fileSourceDto.getUpdatedAt()).isEqualTo(NOW);
 DbFileSources.Data data = fileSourceDto.getSourceData();
 assertThat(data.getLinesCount()).isEqualTo(2);
 assertThat(data.getLines(0).getLine()).isEqualTo(1);
 assertThat(data.getLines(0).getSource()).isEqualTo("line1");
 assertThat(data.getLines(1).getLine()).isEqualTo(2);
 assertThat(data.getLines(1).getSource()).isEqualTo("line2");
 verify(fileSourceDataWarnings).commitWarnings();
}

代码示例来源:origin: palantir/atlasdb

private long readValueFromDefaultCell(TableReference tableRef, long ts) {
  byte[] cellContents = Iterables.getOnlyElement(readFromDefaultCell(tableRef, ts).values()).getContents();
  assertThat(cellContents).as("Reading value from table %s at timestamp %s", tableRef, ts).isNotEmpty();
  return PtBytes.toLong(cellContents);
}

代码示例来源:origin: palantir/atlasdb

@Test
public void tablesWithDifferentCapitalizationClaimToHaveMetadata() {
  kvs.createTable(UPPER_UPPER, AtlasDbConstants.GENERIC_TABLE_METADATA);
  kvs.createTable(LOWER_UPPER, AtlasDbConstants.GENERIC_TABLE_METADATA);
  TABLES.forEach(table -> assertThat(kvs.getMetadataForTable(table)).isNotEmpty());
  assertThat(kvs.getMetadataForTable(TableReference.createFromFullyQualifiedName("other.table"))).isEmpty();
}

代码示例来源:origin: org.activiti.cloud.common/activiti-cloud-services-test

public AssertFileContent isFile() {
  assertThat(response).isNotNull();
  assertThat(response.getContentType()).isNotNull();
  assertThat(response.getContentAsByteArray()).isNotEmpty();
  assertThat(response.getHeader(CONTENT_DISPOSITION))
      .isNotEmpty()
      .startsWith(ATTACHMENT_CONTENT_DISPOSITION);
  String filename = response.getHeader(CONTENT_DISPOSITION)
      .substring(ATTACHMENT_CONTENT_DISPOSITION.length());
  return new AssertFileContent(new FileContent(filename,
                         response.getContentType(),
                         response.getContentAsByteArray()));
}

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

@Test
  public void sendRawTransaction() {
    byte[] res = txApiImpl.sendRawTransaction(tx.toBinary());
    log.debug("\n\nres :: " + Hex.encodeHexString(res));
    assertThat(res).isNotEmpty();
  }
}

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

@Test
public void sendRawTransactionTest() {
  // Request Transaction with byteArr
  try {
    byte[] input = createTx().toBinary();
    // Convert byteArray to Transaction
    assertThat(TX_API.sendRawTransaction(input)).isNotEmpty();
  } catch (Exception e) {
    log.debug(e.getMessage());
  }
}

代码示例来源:origin: io.vertx/vertx-config

@Test
public void testWithBinary(TestContext tc) {
 Async async = tc.async();
 retriever = ConfigRetriever.create(vertx,
   new ConfigRetrieverOptions()
     .addStore(
       new ConfigStoreOptions()
         .setType("file")
         .setFormat("raw")
         .setConfig(
           new JsonObject()
             .put("path", "src/test/resources/raw/logo-white-big.png")
             .put("raw.type", "binary")
             .put("raw.key", "logo")))
 );
 retriever.getConfig(ar -> {
  assertThat(ar.result()).isNotNull().isNotEmpty();
  assertThat(ar.result().getBinary("logo")).isNotEmpty();
  async.complete();
 });
}

代码示例来源:origin: vert-x3/vertx-config

@Test
public void testWithBinary(TestContext tc) {
 Async async = tc.async();
 retriever = ConfigRetriever.create(vertx,
   new ConfigRetrieverOptions()
     .addStore(
       new ConfigStoreOptions()
         .setType("file")
         .setFormat("raw")
         .setConfig(
           new JsonObject()
             .put("path", "src/test/resources/raw/logo-white-big.png")
             .put("raw.type", "binary")
             .put("raw.key", "logo")))
 );
 retriever.getConfig(ar -> {
  assertThat(ar.result()).isNotNull().isNotEmpty();
  assertThat(ar.result().getBinary("logo")).isNotEmpty();
  async.complete();
 });
}

代码示例来源:origin: vert-x3/vertx-config

assertThat(json.getBinary("picture")).isNotEmpty();

相关文章