1 // Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
2 //  This source code is licensed under both the GPLv2 (found in the
3 //  COPYING file in the root directory) and Apache 2.0 License
4 //  (found in the LICENSE.Apache file in the root directory).
5 
6 package org.rocksdb;
7 
8 import org.junit.Test;
9 
10 import static org.assertj.core.api.Assertions.assertThat;
11 
12 public class FlushOptionsTest {
13 
14   @Test
waitForFlush()15   public void waitForFlush() {
16     try (final FlushOptions flushOptions = new FlushOptions()) {
17       assertThat(flushOptions.waitForFlush()).isTrue();
18       flushOptions.setWaitForFlush(false);
19       assertThat(flushOptions.waitForFlush()).isFalse();
20     }
21   }
22 
23   @Test
allowWriteStall()24   public void allowWriteStall() {
25     try (final FlushOptions flushOptions = new FlushOptions()) {
26       assertThat(flushOptions.allowWriteStall()).isFalse();
27       flushOptions.setAllowWriteStall(true);
28       assertThat(flushOptions.allowWriteStall()).isTrue();
29     }
30   }
31 }
32