Search in sources :

Example 1 with Version

use of com.aerospike.client.util.Version in project aerospike-client-java by aerospike.

the class TestAdd method addNullValue.

@Test
public void addNullValue() {
    Version version = Version.getServerVersion(client, null);
    // Do not run on servers < 3.6.1
    if (version.isLess(3, 6, 1)) {
        return;
    }
    Key key = new Key(args.namespace, args.set, "addkey");
    String binName = args.getBinName("addbin");
    // Delete record if it already exists.
    client.delete(null, key);
    Bin bin = new Bin(binName, (Long) null);
    AerospikeException ae = assertThrows(AerospikeException.class, new ThrowingRunnable() {

        public void run() {
            client.add(null, key, bin);
        }
    });
    assertEquals(ae.getResultCode(), ResultCode.PARAMETER_ERROR);
}
Also used : AerospikeException(com.aerospike.client.AerospikeException) Version(com.aerospike.client.util.Version) Bin(com.aerospike.client.Bin) Key(com.aerospike.client.Key) ThrowingRunnable(org.junit.function.ThrowingRunnable) Test(org.junit.Test)

Aggregations

AerospikeException (com.aerospike.client.AerospikeException)1 Bin (com.aerospike.client.Bin)1 Key (com.aerospike.client.Key)1 Version (com.aerospike.client.util.Version)1 Test (org.junit.Test)1 ThrowingRunnable (org.junit.function.ThrowingRunnable)1