use of io.crate.execution.ddl.tables.AlterTableRequest in project crate by crate.
the class AlterTableClusterStateExecutorTest method testAddExistingMetaDoNotAddEmptyValues.
@Test
public void testAddExistingMetaDoNotAddEmptyValues() throws IOException {
AlterTableRequest request = mock(AlterTableRequest.class);
when(request.mappingDeltaAsMap()).thenReturn(Collections.singletonMap("_meta", new HashMap<String, Object>()));
var currentMeta = new HashMap<String, Object>();
assertThat(AlterTableClusterStateExecutor.addExistingMeta(request, currentMeta), containsString("{\"_meta\":{}}"));
verify(request, times(1)).mappingDeltaAsMap();
// DO NOT WANT empty containers and nulls: "{"_meta":{"indices":{},"partitioned_by":[],"primary_keys":null,"check_constraints":null,"constraints":{}}}"
}
Aggregations