use of com.google.appengine.api.datastore.Entity.WrappedValueImpl in project appengine-java-standard by GoogleCloudPlatform.
the class EntityTest method testSetIndexedProperty.
@Test
public void testSetIndexedProperty() {
Entity entity = new Entity("foo");
IllegalArgumentException e1 = assertThrows(IllegalArgumentException.class, () -> entity.setIndexedProperty("prop", new Text("text")));
assertThat(e1).hasMessageThat().contains("is not indexable");
IllegalArgumentException e2 = assertThrows(IllegalArgumentException.class, () -> entity.setIndexedProperty("prop", ImmutableList.of(1L, new Blob(new byte[] { 1 }))));
assertThat(e2).hasMessageThat().contains("is not indexable");
entity.setIndexedProperty("prop", new EmbeddedEntity());
WrappedValueImpl wrappedValue = (WrappedValueImpl) entity.getPropertyMap().get("prop");
assertThat(wrappedValue.isIndexed()).isTrue();
assertThat(wrappedValue.getForceIndexedEmbeddedEntity()).isTrue();
}
Aggregations