Search in sources :

Example 1 with MapIndex

use of com.tangosol.util.MapIndex in project coherence-spring by coherence-community.

the class ExtractorConfigurationTests method setup.

@BeforeEach
void setup() {
    this.phoneNumber = new PhoneNumber(44, "04242424242");
    this.person = new Person("Arthur", "Dent", LocalDate.of(1978, 3, 8), this.phoneNumber);
    this.binaryKey = ExternalizableHelper.toBinary("AD", this.pofContext);
    this.binaryPerson = ExternalizableHelper.toBinary(this.person, this.pofContext);
    BackingMapContext ctx = mock(BackingMapContext.class);
    Map<ValueExtractor, MapIndex> index = new HashMap<>();
    when(ctx.getIndexMap()).thenReturn(index);
    this.entry = new BackingMapBinaryEntry(this.binaryKey, this.binaryPerson, this.binaryPerson, null) {

        @Override
        public Object getKey() {
            return "AD";
        }

        @Override
        public Object getValue() {
            return ExtractorConfigurationTests.this.person;
        }

        @Override
        public BackingMapContext getBackingMapContext() {
            return ctx;
        }

        @Override
        public Serializer getSerializer() {
            return ExtractorConfigurationTests.this.pofContext;
        }
    };
}
Also used : BackingMapContext(com.tangosol.net.BackingMapContext) BackingMapBinaryEntry(com.tangosol.net.cache.BackingMapBinaryEntry) HashMap(java.util.HashMap) PhoneNumber(data.PhoneNumber) ValueExtractor(com.tangosol.util.ValueExtractor) MapIndex(com.tangosol.util.MapIndex) Person(data.Person) Serializer(com.tangosol.io.Serializer) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

Serializer (com.tangosol.io.Serializer)1 BackingMapContext (com.tangosol.net.BackingMapContext)1 BackingMapBinaryEntry (com.tangosol.net.cache.BackingMapBinaryEntry)1 MapIndex (com.tangosol.util.MapIndex)1 ValueExtractor (com.tangosol.util.ValueExtractor)1 Person (data.Person)1 PhoneNumber (data.PhoneNumber)1 HashMap (java.util.HashMap)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1