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

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

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

AbstractByteArrayAssert.isNull介绍

暂无

代码示例

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

@Override
 public void consume(int lineIdx, @Nullable byte[] hash) {
  switch (lineIdx) {
   case 1:
    assertThat(hash).isNull();
    break;
   default:
    fail("Invalid line");
  }
 }
});

代码示例来源:origin: line/armeria

@Test
public void testServiceWithoutKeySelector() {
  final KafkaStructuredLoggingServiceExposed service =
      new KafkaStructuredLoggingServiceExposed(producer, null, false);
  final SimpleStructuredLog log = new SimpleStructuredLog("kawamuray");
  service.writeLog(null, log);
  verify(producer, times(1)).send(captor.capture(), any(Callback.class));
  final ProducerRecord<byte[], SimpleStructuredLog> record = captor.getValue();
  assertThat(record.key()).isNull();
  assertThat(record.value()).isEqualTo(log);
}

代码示例来源:origin: com.datastax.oss/native-protocol

public RowsMetadataAssert hasNoNewResultMetadataId() {
  assertThat(actual.newResultMetadataId).isNull();
  return this;
 }
}

代码示例来源:origin: com.hubspot/Ringleader

@Test
public void itSendsEventWhenNodeIsDeleted() {
 watcher.start();
 waitForEvents();
 assertThat(curatorCounter.get()).isEqualTo(1);
 assertThat(events).hasSize(1);
 assertThat(events.get(0).getType()).isEqualTo(Type.NODE_UPDATED);
 assertThat(events.get(0).getStat().getVersion()).isEqualTo(0);
 assertThat(events.get(0).getData()).isEqualTo("0".getBytes());
 deleteData();
 waitForEvents();
 assertThat(curatorCounter.get()).isEqualTo(1);
 assertThat(events).hasSize(2);
 assertThat(events.get(1).getType()).isEqualTo(Type.NODE_DELETED);
 assertThat(events.get(1).getStat()).isNull();
 assertThat(events.get(1).getData()).isNull();
}

代码示例来源:origin: line/line-bot-sdk-java

@Test
public void parseBytesOrNullTestForNull() throws Exception {
  // Do
  byte[] bytes = BeaconContentUtil.parseBytesOrNull(null);
  // Verify
  assertThat(bytes).isNull();
}

代码示例来源:origin: com.hubspot.mesos.rx.java/mesos-rxjava-recordio

@NotNull
static List<Event> runTestOnChunks(@NotNull final List<ByteBuf> chunks) {
  final TestSubscriber<byte[]> child = new TestSubscriber<>();
  final Subscriber<ByteBuf> call = new RecordIOOperator().call(child);
  assertThat(call).isInstanceOf(RecordIOOperator.RecordIOSubscriber.class);
  final RecordIOOperator.RecordIOSubscriber subscriber = (RecordIOOperator.RecordIOSubscriber) call;
  chunks.stream().forEach(subscriber::onNext);
  child.assertNoErrors();
  child.assertNotCompleted();
  child.assertNoTerminalEvent();
  assertThat(subscriber.messageSizeBytesBuffer).isEmpty();
  assertThat(subscriber.messageBytes).isNull();
  assertThat(subscriber.remainingBytesForMessage).isEqualTo(0);
  return CollectionUtils.listMap(child.getOnNextEvents(), (bs) -> {
    try {
      return Event.parseFrom(bs);
    } catch (InvalidProtocolBufferException e) {
      throw new RuntimeException(e);
    }
  });
}

代码示例来源:origin: segmentio/analytics-android

@Test
public void removeMultipleDoesNotCorrupt() throws IOException {
 QueueFile queue = new QueueFile(file);
 for (int i = 0; i < 10; i++) {
  queue.add(values[i]);
 }
 queue.remove(1);
 assertThat(queue.size()).isEqualTo(9);
 assertThat(queue.peek()).isEqualTo(values[1]);
 queue.remove(3);
 queue = new QueueFile(file);
 assertThat(queue.size()).isEqualTo(6);
 assertThat(queue.peek()).isEqualTo(values[4]);
 queue.remove(6);
 assertThat(queue.isEmpty()).isTrue();
 assertThat(queue.peek()).isNull();
}

代码示例来源:origin: segmentio/analytics-android

@Test
public void testClearDoesNotCorrupt() throws IOException {
 QueueFile queue = new QueueFile(file);
 byte[] stuff = values[253];
 queue.add(stuff);
 queue.clear();
 queue = new QueueFile(file);
 assertThat(queue.isEmpty()).isTrue();
 assertThat(queue.peek()).isNull();
 queue.add(values[25]);
 assertThat(queue.peek()).isEqualTo(values[25]);
}

代码示例来源:origin: line/centraldogma

null, null, USERNAME, PUBLIC_KEY, PRIVATE_KEY, null).passphrase()).isNull();

代码示例来源:origin: line/line-bot-sdk-java

@Test
public void testBeacon() throws IOException {
  parse("callback/beacon.json", callbackRequest -> {
    assertDestination(callbackRequest);
    assertThat(callbackRequest.getEvents()).hasSize(1);
    Event event = callbackRequest.getEvents().get(0);
    assertThat(event).isInstanceOf(BeaconEvent.class);
    assertThat(event.getSource())
        .isInstanceOf(UserSource.class);
    assertThat(event.getSource().getUserId())
        .isEqualTo("U012345678901234567890123456789ab");
    assertThat(event.getTimestamp())
        .isEqualTo(Instant.parse("2016-05-07T13:57:59.859Z"));
    BeaconEvent beaconEvent = (BeaconEvent) event;
    assertThat(beaconEvent.getBeacon().getHwid())
        .isEqualTo("374591320");
    assertThat(beaconEvent.getBeacon().getType())
        .isEqualTo("enter");
    assertThat(beaconEvent.getBeacon().getDeviceMessage())
        .isNull();
    assertThat(beaconEvent.getBeacon().getDeviceMessageAsHex())
        .isNull();
  });
}

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

@Test
public void shouldBeReset() {
  LevelDbDataSource ds = new LevelDbDataSource(dbPath, "reset-test");
  ds.init();
  byte[] key = randomBytes(32);
  byte[] value = putDummyRow(ds, key);
  byte[] foundValue = ds.get(key);
  assertThat(foundValue).isEqualTo(value);
  ds.reset();
  foundValue = ds.get(key);
  assertThat(foundValue).isNull();
}

相关文章