Search in sources :

Example 1 with ServiceConfiguration

use of com.google.cloud.spring.data.datastore.entities.ServiceConfiguration in project spring-cloud-gcp by GoogleCloudPlatform.

the class Employee method mapSubclass.

@Test
void mapSubclass() {
    CustomMap customMap1 = new CustomMap();
    customMap1.put("key1", "val1");
    ServiceConfiguration service1 = new ServiceConfiguration("service1", customMap1);
    CustomMap customMap2 = new CustomMap();
    customMap2.put("key2", "val2");
    ServiceConfiguration service2 = new ServiceConfiguration("service2", customMap2);
    this.datastoreTemplate.saveAll(Arrays.asList(service1, service2));
    waitUntilTrue(() -> this.datastoreTemplate.count(ServiceConfiguration.class) == 2);
    Collection<ServiceConfiguration> events = this.datastoreTemplate.findAll(ServiceConfiguration.class);
    assertThat(events).containsExactlyInAnyOrder(service1, service2);
}
Also used : ServiceConfiguration(com.google.cloud.spring.data.datastore.entities.ServiceConfiguration) CustomMap(com.google.cloud.spring.data.datastore.entities.CustomMap) Test(org.junit.jupiter.api.Test)

Aggregations

CustomMap (com.google.cloud.spring.data.datastore.entities.CustomMap)1 ServiceConfiguration (com.google.cloud.spring.data.datastore.entities.ServiceConfiguration)1 Test (org.junit.jupiter.api.Test)1