DATACOUCH-675 - Factor out interfaces for common methods. (#293)
Added interfaces for apis on core objects which are common among many objects. For instance withExpiry and withExpirty on all the insert/replace/upsert/remove objects. The definition of an interface simplyfies testing of all the possible combinations - instead of having four (or eight, counting Reactive), there is one interface to test them all. Co-authored-by: mikereiche <michael.reiche@couchbase.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright 2020 the original author or authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.couchbase.domain;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.springframework.data.couchbase.core.mapping.Document;
|
||||
|
||||
/**
|
||||
* Annotated User entity for tests
|
||||
*
|
||||
* @author Michael Reiche
|
||||
*/
|
||||
|
||||
@Document(expiryExpression = "${myExpiryExpression}", expiryUnit = TimeUnit.SECONDS)
|
||||
public class UserAnnotated2 extends User {
|
||||
static {
|
||||
System.setProperty("myExpiryExpression", "2");
|
||||
}
|
||||
|
||||
public UserAnnotated2(String id, String firstname, String lastname) {
|
||||
super(id, firstname, lastname);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user