Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mchades committed Jan 18, 2024
1 parent bb8c920 commit 4b2d717
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright 2024 Datastrato Pvt Ltd.
* This software is licensed under the Apache License version 2.
*/
package com.datastrato.gravitino.dto.requests;

import com.datastrato.gravitino.json.JsonUtils;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public class TestTableCreateRequest {
@Test
public void testTableCreateRequest() throws JsonProcessingException {
String nullComment =
"{\n"
+ " \"name\": \"table\",\n"
+ " \"comment\": \"\",\n"
+ " \"columns\": [\n"
+ " {\n"
+ " \"name\": \"column\",\n"
+ " \"type\": \"string\",\n"
+ " \"comment\": null,\n"
+ " \"nullable\": true,\n"
+ " \"autoIncrement\": false\n"
+ " }\n"
+ " ],\n"
+ " \"properties\": null,\n"
+ " \"sortOrders\": null,\n"
+ " \"distribution\": null,\n"
+ " \"partitioning\": null\n"
+ "}";
TableCreateRequest actualRequest =
JsonUtils.objectMapper().readValue(nullComment, TableCreateRequest.class);
Assertions.assertEquals("", actualRequest.getComment());
}
}

0 comments on commit 4b2d717

Please sign in to comment.