mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-26 00:04:52 +00:00
Add table entity name pattern (#9970)
* Added ()0 to table entityName for oracle metadata * move # character to columnName pattern * Test newly allowed characters in table name and columns --------- Co-authored-by: Teddy Crepineau <teddy.crepineau@gmail.com> Co-authored-by: sureshms <srini30005@gmail.com>
This commit is contained in:
parent
813d2c4fe6
commit
8b45b639fd
@ -181,14 +181,14 @@ public abstract class EntityResourceTest<T extends EntityInterface, K extends Cr
|
|||||||
protected boolean supportsSoftDelete;
|
protected boolean supportsSoftDelete;
|
||||||
protected boolean supportsFieldsQueryParam = true;
|
protected boolean supportsFieldsQueryParam = true;
|
||||||
protected boolean supportsEmptyDescription = true;
|
protected boolean supportsEmptyDescription = true;
|
||||||
protected String supportedNameCharacters = ".' _"; // Special characters supported in the entity name
|
protected String supportedNameCharacters = "_'-.&"; // Special characters supported in the entity name
|
||||||
protected final boolean supportsCustomExtension;
|
protected final boolean supportsCustomExtension;
|
||||||
|
|
||||||
public static final String DATA_STEWARD_ROLE_NAME = "DataSteward";
|
public static final String DATA_STEWARD_ROLE_NAME = "DataSteward";
|
||||||
public static final String DATA_CONSUMER_ROLE_NAME = "DataConsumer";
|
public static final String DATA_CONSUMER_ROLE_NAME = "DataConsumer";
|
||||||
|
|
||||||
public static final String ENTITY_LINK_MATCH_ERROR =
|
public static final String ENTITY_LINK_MATCH_ERROR =
|
||||||
"[entityLink must match \"^<#E::\\w+::[\\w'\\- .&/:+\"\\\\]+>$\"]";
|
"[entityLink must match \"^<#E::\\w+::[\\w'\\- .&/:+\"\\\\()$#]+>$\"]";
|
||||||
|
|
||||||
// Users
|
// Users
|
||||||
public static User USER1;
|
public static User USER1;
|
||||||
@ -281,7 +281,7 @@ public abstract class EntityResourceTest<T extends EntityInterface, K extends Cr
|
|||||||
|
|
||||||
public static KpiTarget KPI_TARGET;
|
public static KpiTarget KPI_TARGET;
|
||||||
|
|
||||||
public static final String C1 = "c'_+ 1";
|
public static final String C1 = "c'_+# 1";
|
||||||
public static final String C2 = "c2";
|
public static final String C2 = "c2";
|
||||||
public static final String C3 = "\"c.3\"";
|
public static final String C3 = "\"c.3\"";
|
||||||
public static List<Column> COLUMNS;
|
public static List<Column> COLUMNS;
|
||||||
@ -1624,11 +1624,11 @@ public abstract class EntityResourceTest<T extends EntityInterface, K extends Cr
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected final WebTarget getFollowersCollection(UUID id) {
|
protected final WebTarget getFollowersCollection(UUID id) {
|
||||||
return getResource(collectionName + "/" + id + "/followers");
|
return getResource(id).path("followers");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final WebTarget getFollowerResource(UUID id, UUID userId) {
|
protected final WebTarget getFollowerResource(UUID id, UUID userId) {
|
||||||
return getResource(collectionName + "/" + id + "/followers/" + userId);
|
return getFollowersCollection(id).path("/" + userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final T getEntity(UUID id, Map<String, String> authHeaders) throws HttpResponseException {
|
protected final T getEntity(UUID id, Map<String, String> authHeaders) throws HttpResponseException {
|
||||||
|
|||||||
@ -26,7 +26,6 @@ import org.openmetadata.schema.analytics.type.WebAnalyticEventType;
|
|||||||
import org.openmetadata.schema.api.tests.CreateWebAnalyticEvent;
|
import org.openmetadata.schema.api.tests.CreateWebAnalyticEvent;
|
||||||
import org.openmetadata.schema.type.MetadataOperation;
|
import org.openmetadata.schema.type.MetadataOperation;
|
||||||
import org.openmetadata.service.Entity;
|
import org.openmetadata.service.Entity;
|
||||||
import org.openmetadata.service.OpenMetadataApplicationTest;
|
|
||||||
import org.openmetadata.service.resources.EntityResourceTest;
|
import org.openmetadata.service.resources.EntityResourceTest;
|
||||||
import org.openmetadata.service.util.ResultList;
|
import org.openmetadata.service.util.ResultList;
|
||||||
import org.openmetadata.service.util.TestUtils;
|
import org.openmetadata.service.util.TestUtils;
|
||||||
@ -174,22 +173,21 @@ public class WebAnalyticEventResourceTest extends EntityResourceTest<WebAnalytic
|
|||||||
@Override
|
@Override
|
||||||
public void assertFieldChange(String fieldName, Object expected, Object actual) {}
|
public void assertFieldChange(String fieldName, Object expected, Object actual) {}
|
||||||
|
|
||||||
public static void putWebAnalyticEventData(WebAnalyticEventData data, Map<String, String> authHeaders)
|
public void putWebAnalyticEventData(WebAnalyticEventData data, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("analytics/webAnalyticEvent/collect");
|
WebTarget target = getCollection().path("/collect");
|
||||||
TestUtils.put(target, data, OK, authHeaders);
|
TestUtils.put(target, data, OK, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void deleteWebAnalyticEventData(Long timestamp, Map<String, String> authHeaders) throws IOException {
|
public void deleteWebAnalyticEventData(Long timestamp, Map<String, String> authHeaders) throws IOException {
|
||||||
String url =
|
String url = String.format("/%s/%s/collect", WebAnalyticEventType.PAGE_VIEW.value(), timestamp);
|
||||||
String.format("analytics/webAnalyticEvent/%s/%s/collect", WebAnalyticEventType.PAGE_VIEW.value(), timestamp);
|
WebTarget target = getCollection().path(url);
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource(url);
|
|
||||||
TestUtils.delete(target, WebAnalyticEvent.class, authHeaders);
|
TestUtils.delete(target, WebAnalyticEvent.class, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResultList<WebAnalyticEventData> getWebAnalyticEventData(
|
public ResultList<WebAnalyticEventData> getWebAnalyticEventData(
|
||||||
String eventType, Long start, Long end, Map<String, String> authHeaders) throws HttpResponseException {
|
String eventType, Long start, Long end, Map<String, String> authHeaders) throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("analytics/webAnalyticEvent/collect");
|
WebTarget target = getCollection().path("/collect");
|
||||||
target = target.queryParam("startTs", start);
|
target = target.queryParam("startTs", start);
|
||||||
target = target.queryParam("endTs", end);
|
target = target.queryParam("endTs", end);
|
||||||
target = target.queryParam("eventType", eventType);
|
target = target.queryParam("eventType", eventType);
|
||||||
|
|||||||
@ -122,7 +122,6 @@ import org.openmetadata.schema.type.TableType;
|
|||||||
import org.openmetadata.schema.type.TagLabel;
|
import org.openmetadata.schema.type.TagLabel;
|
||||||
import org.openmetadata.schema.type.TagLabel.LabelType;
|
import org.openmetadata.schema.type.TagLabel.LabelType;
|
||||||
import org.openmetadata.service.Entity;
|
import org.openmetadata.service.Entity;
|
||||||
import org.openmetadata.service.OpenMetadataApplicationTest;
|
|
||||||
import org.openmetadata.service.exception.CatalogExceptionMessage;
|
import org.openmetadata.service.exception.CatalogExceptionMessage;
|
||||||
import org.openmetadata.service.resources.EntityResourceTest;
|
import org.openmetadata.service.resources.EntityResourceTest;
|
||||||
import org.openmetadata.service.resources.databases.TableResource.TableList;
|
import org.openmetadata.service.resources.databases.TableResource.TableList;
|
||||||
@ -147,6 +146,7 @@ public class TableResourceTest extends EntityResourceTest<Table, CreateTable> {
|
|||||||
|
|
||||||
public TableResourceTest() {
|
public TableResourceTest() {
|
||||||
super(TABLE, Table.class, TableList.class, "tables", TableResource.FIELDS);
|
super(TABLE, Table.class, TableList.class, "tables", TableResource.FIELDS);
|
||||||
|
supportedNameCharacters = "_'- .()$";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setupDatabaseSchemas(TestInfo test) throws IOException {
|
public void setupDatabaseSchemas(TestInfo test) throws IOException {
|
||||||
@ -1744,7 +1744,7 @@ public class TableResourceTest extends EntityResourceTest<Table, CreateTable> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void deleteAndCheckLocation(Table table) throws HttpResponseException {
|
private void deleteAndCheckLocation(Table table) throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource(String.format("tables/%s/location", table.getId()));
|
WebTarget target = getResource(table.getId()).path("/location");
|
||||||
TestUtils.delete(target, TestUtils.TEST_AUTH_HEADERS);
|
TestUtils.delete(target, TestUtils.TEST_AUTH_HEADERS);
|
||||||
checkLocationDeleted(table.getId(), TestUtils.TEST_AUTH_HEADERS);
|
checkLocationDeleted(table.getId(), TestUtils.TEST_AUTH_HEADERS);
|
||||||
}
|
}
|
||||||
@ -1756,7 +1756,7 @@ public class TableResourceTest extends EntityResourceTest<Table, CreateTable> {
|
|||||||
|
|
||||||
public void addAndCheckLocation(Table table, UUID locationId, Status status, Map<String, String> authHeaders)
|
public void addAndCheckLocation(Table table, UUID locationId, Status status, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource(String.format("tables/%s/location", table.getId()));
|
WebTarget target = getResource(table.getId()).path("/location");
|
||||||
TestUtils.put(target, locationId, status, authHeaders);
|
TestUtils.put(target, locationId, status, authHeaders);
|
||||||
|
|
||||||
// GET .../tables/{tableId} returns newly added location
|
// GET .../tables/{tableId} returns newly added location
|
||||||
@ -1901,95 +1901,90 @@ public class TableResourceTest extends EntityResourceTest<Table, CreateTable> {
|
|||||||
return createEntity(create, ADMIN_AUTH_HEADERS).withDatabase(database.getEntityReference());
|
return createEntity(create, ADMIN_AUTH_HEADERS).withDatabase(database.getEntityReference());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Table putJoins(UUID tableId, TableJoins joins, Map<String, String> authHeaders)
|
public Table putJoins(UUID tableId, TableJoins joins, Map<String, String> authHeaders) throws HttpResponseException {
|
||||||
throws HttpResponseException {
|
WebTarget target = getResource(tableId).path("/joins");
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/joins");
|
|
||||||
return TestUtils.put(target, joins, Table.class, OK, authHeaders);
|
return TestUtils.put(target, joins, Table.class, OK, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Table putSampleData(UUID tableId, TableData data, Map<String, String> authHeaders)
|
public Table putSampleData(UUID tableId, TableData data, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/sampleData");
|
WebTarget target = getResource(tableId).path("/sampleData");
|
||||||
return TestUtils.put(target, data, Table.class, OK, authHeaders);
|
return TestUtils.put(target, data, Table.class, OK, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Table getSampleData(UUID tableId, Map<String, String> authHeaders) throws HttpResponseException {
|
public Table getSampleData(UUID tableId, Map<String, String> authHeaders) throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/sampleData");
|
WebTarget target = getResource(tableId).path("/sampleData");
|
||||||
return TestUtils.get(target, Table.class, authHeaders);
|
return TestUtils.get(target, Table.class, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Table putTableProfilerConfig(UUID tableId, TableProfilerConfig data, Map<String, String> authHeaders)
|
public Table putTableProfilerConfig(UUID tableId, TableProfilerConfig data, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/tableProfilerConfig");
|
WebTarget target = getResource(tableId).path("/tableProfilerConfig");
|
||||||
return TestUtils.put(target, data, Table.class, OK, authHeaders);
|
return TestUtils.put(target, data, Table.class, OK, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Table deleteTableProfilerConfig(UUID tableId, Map<String, String> authHeaders)
|
public Table deleteTableProfilerConfig(UUID tableId, Map<String, String> authHeaders) throws HttpResponseException {
|
||||||
throws HttpResponseException {
|
WebTarget target = getResource(tableId).path("/tableProfilerConfig");
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/tableProfilerConfig");
|
|
||||||
return TestUtils.delete(target, Table.class, authHeaders);
|
return TestUtils.delete(target, Table.class, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Table getLatestTableProfile(String fqn, Map<String, String> authHeaders) throws HttpResponseException {
|
public Table getLatestTableProfile(String fqn, Map<String, String> authHeaders) throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + fqn + "/tableProfile/latest");
|
WebTarget target = getCollection().path("/" + fqn + "/tableProfile/latest");
|
||||||
return TestUtils.get(target, Table.class, authHeaders);
|
return TestUtils.get(target, Table.class, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Table putTableProfileData(UUID tableId, CreateTableProfile data, Map<String, String> authHeaders)
|
public Table putTableProfileData(UUID tableId, CreateTableProfile data, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/tableProfile");
|
WebTarget target = getResource(tableId).path("/tableProfile");
|
||||||
return TestUtils.put(target, data, Table.class, OK, authHeaders);
|
return TestUtils.put(target, data, Table.class, OK, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void deleteTableProfile(String fqn, String entityType, Long timestamp, Map<String, String> authHeaders)
|
public void deleteTableProfile(String fqn, String entityType, Long timestamp, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target =
|
WebTarget target = getCollection().path("/" + fqn + "/" + entityType + "/" + timestamp + "/profile");
|
||||||
OpenMetadataApplicationTest.getResource("tables/" + fqn + "/" + entityType + "/" + timestamp + "/profile");
|
|
||||||
TestUtils.delete(target, authHeaders);
|
TestUtils.delete(target, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResultList<TableProfile> getTableProfiles(
|
public ResultList<TableProfile> getTableProfiles(
|
||||||
String fqn, Long startTs, Long endTs, Map<String, String> authHeaders) throws HttpResponseException {
|
String fqn, Long startTs, Long endTs, Map<String, String> authHeaders) throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + fqn + "/tableProfile");
|
WebTarget target = getCollection().path("/" + fqn + "/tableProfile");
|
||||||
target = target.queryParam("startTs", startTs).queryParam("endTs", endTs);
|
target = target.queryParam("startTs", startTs).queryParam("endTs", endTs);
|
||||||
return TestUtils.get(target, TableResource.TableProfileList.class, authHeaders);
|
return TestUtils.get(target, TableResource.TableProfileList.class, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResultList<ColumnProfile> getColumnProfiles(
|
public ResultList<ColumnProfile> getColumnProfiles(
|
||||||
String fqn, Long startTs, Long endTs, Map<String, String> authHeaders) throws HttpResponseException {
|
String fqn, Long startTs, Long endTs, Map<String, String> authHeaders) throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + fqn + "/columnProfile");
|
WebTarget target = getCollection().path("/" + fqn + "/columnProfile");
|
||||||
target = target.queryParam("startTs", startTs).queryParam("endTs", endTs);
|
target = target.queryParam("startTs", startTs).queryParam("endTs", endTs);
|
||||||
return TestUtils.get(target, TableResource.ColumnProfileList.class, authHeaders);
|
return TestUtils.get(target, TableResource.ColumnProfileList.class, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Table putTableQueriesData(UUID tableId, SQLQuery data, Map<String, String> authHeaders)
|
public Table putTableQueriesData(UUID tableId, SQLQuery data, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/tableQuery");
|
WebTarget target = getResource(tableId).path("/tableQuery");
|
||||||
return TestUtils.put(target, data, Table.class, OK, authHeaders);
|
return TestUtils.put(target, data, Table.class, OK, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Table getTableQueriesData(UUID tableId, Map<String, String> authHeaders) throws HttpResponseException {
|
public Table getTableQueriesData(UUID tableId, Map<String, String> authHeaders) throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/tableQuery");
|
WebTarget target = getResource(tableId).path("/tableQuery");
|
||||||
return TestUtils.get(target, Table.class, authHeaders);
|
return TestUtils.get(target, Table.class, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Table putTableDataModel(UUID tableId, DataModel dataModel, Map<String, String> authHeaders)
|
public Table putTableDataModel(UUID tableId, DataModel dataModel, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/dataModel");
|
WebTarget target = getResource(tableId).path("/dataModel");
|
||||||
return TestUtils.put(target, dataModel, Table.class, OK, authHeaders);
|
return TestUtils.put(target, dataModel, Table.class, OK, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Table putCustomMetric(UUID tableId, CreateCustomMetric data, Map<String, String> authHeaders)
|
public Table putCustomMetric(UUID tableId, CreateCustomMetric data, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("tables/" + tableId + "/customMetric");
|
WebTarget target = getResource(tableId).path("/customMetric");
|
||||||
return TestUtils.put(target, data, Table.class, OK, authHeaders);
|
return TestUtils.put(target, data, Table.class, OK, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Table deleteCustomMetric(
|
public Table deleteCustomMetric(UUID tableId, String columnName, String metricName, Map<String, String> authHeaders)
|
||||||
UUID tableId, String columnName, String metricName, Map<String, String> authHeaders)
|
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target =
|
WebTarget target = getResource(tableId).path("/customMetric/" + columnName + "/" + metricName);
|
||||||
OpenMetadataApplicationTest.getResource("tables/" + tableId + "/customMetric/" + columnName + "/" + metricName);
|
|
||||||
return TestUtils.delete(target, Table.class, authHeaders);
|
return TestUtils.delete(target, Table.class, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,6 @@ import org.openmetadata.schema.type.ChangeDescription;
|
|||||||
import org.openmetadata.schema.type.Column;
|
import org.openmetadata.schema.type.Column;
|
||||||
import org.openmetadata.schema.type.ColumnDataType;
|
import org.openmetadata.schema.type.ColumnDataType;
|
||||||
import org.openmetadata.service.Entity;
|
import org.openmetadata.service.Entity;
|
||||||
import org.openmetadata.service.OpenMetadataApplicationTest;
|
|
||||||
import org.openmetadata.service.resources.EntityResourceTest;
|
import org.openmetadata.service.resources.EntityResourceTest;
|
||||||
import org.openmetadata.service.resources.databases.TableResourceTest;
|
import org.openmetadata.service.resources.databases.TableResourceTest;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
@ -410,9 +409,9 @@ public class TestCaseResourceTest extends EntityResourceTest<TestCase, CreateTes
|
|||||||
verifyTestCases(testCaseList, expectedTestCaseList, 12);
|
verifyTestCases(testCaseList, expectedTestCaseList, 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void putTestCaseResult(String fqn, TestCaseResult data, Map<String, String> authHeaders)
|
public void putTestCaseResult(String fqn, TestCaseResult data, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("testCase/" + fqn + "/testCaseResult");
|
WebTarget target = getCollection().path("/" + fqn + "/testCaseResult");
|
||||||
TestUtils.put(target, data, CREATED, authHeaders);
|
TestUtils.put(target, data, CREATED, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -468,24 +467,24 @@ public class TestCaseResourceTest extends EntityResourceTest<TestCase, CreateTes
|
|||||||
permissionNotAllowed(TEST_USER_NAME, List.of(EDIT_TESTS)));
|
permissionNotAllowed(TEST_USER_NAME, List.of(EDIT_TESTS)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void deleteTestCaseResult(String fqn, Long timestamp, Map<String, String> authHeaders)
|
public void deleteTestCaseResult(String fqn, Long timestamp, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("testCase/" + fqn + "/testCaseResult/" + timestamp);
|
WebTarget target = getCollection().path("/" + fqn + "/testCaseResult/" + timestamp);
|
||||||
TestUtils.delete(target, authHeaders);
|
TestUtils.delete(target, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResultList<TestCaseResult> getTestCaseResults(
|
public ResultList<TestCaseResult> getTestCaseResults(
|
||||||
String fqn, Long start, Long end, Map<String, String> authHeaders) throws HttpResponseException {
|
String fqn, Long start, Long end, Map<String, String> authHeaders) throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("testCase/" + fqn + "/testCaseResult");
|
WebTarget target = getCollection().path("/" + fqn + "/testCaseResult");
|
||||||
target = target.queryParam("startTs", start);
|
target = target.queryParam("startTs", start);
|
||||||
target = target.queryParam("endTs", end);
|
target = target.queryParam("endTs", end);
|
||||||
return TestUtils.get(target, TestCaseResource.TestCaseResultList.class, authHeaders);
|
return TestUtils.get(target, TestCaseResource.TestCaseResultList.class, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResultList<TestCase> getTestCases(
|
public ResultList<TestCase> getTestCases(
|
||||||
Integer limit, String fields, String link, Boolean includeAll, Map<String, String> authHeaders)
|
Integer limit, String fields, String link, Boolean includeAll, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("testCase");
|
WebTarget target = getCollection();
|
||||||
target = limit != null ? target.queryParam("limit", limit) : target;
|
target = limit != null ? target.queryParam("limit", limit) : target;
|
||||||
target = target.queryParam("fields", fields);
|
target = target.queryParam("fields", fields);
|
||||||
if (link != null) {
|
if (link != null) {
|
||||||
@ -497,10 +496,10 @@ public class TestCaseResourceTest extends EntityResourceTest<TestCase, CreateTes
|
|||||||
return TestUtils.get(target, TestCaseResource.TestCaseList.class, authHeaders);
|
return TestUtils.get(target, TestCaseResource.TestCaseList.class, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResultList<TestCase> getTestCases(
|
public ResultList<TestCase> getTestCases(
|
||||||
Integer limit, String fields, TestSuite testSuite, Boolean includeAll, Map<String, String> authHeaders)
|
Integer limit, String fields, TestSuite testSuite, Boolean includeAll, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("testCase");
|
WebTarget target = getCollection();
|
||||||
target = limit != null ? target.queryParam("limit", limit) : target;
|
target = limit != null ? target.queryParam("limit", limit) : target;
|
||||||
target = target.queryParam("fields", fields);
|
target = target.queryParam("fields", fields);
|
||||||
target = target.queryParam("testSuiteId", testSuite.getId());
|
target = target.queryParam("testSuiteId", testSuite.getId());
|
||||||
|
|||||||
@ -24,7 +24,6 @@ import org.openmetadata.schema.tests.TestCase;
|
|||||||
import org.openmetadata.schema.tests.TestSuite;
|
import org.openmetadata.schema.tests.TestSuite;
|
||||||
import org.openmetadata.schema.type.EntityReference;
|
import org.openmetadata.schema.type.EntityReference;
|
||||||
import org.openmetadata.service.Entity;
|
import org.openmetadata.service.Entity;
|
||||||
import org.openmetadata.service.OpenMetadataApplicationTest;
|
|
||||||
import org.openmetadata.service.resources.EntityResourceTest;
|
import org.openmetadata.service.resources.EntityResourceTest;
|
||||||
import org.openmetadata.service.util.ResultList;
|
import org.openmetadata.service.util.ResultList;
|
||||||
import org.openmetadata.service.util.TestUtils;
|
import org.openmetadata.service.util.TestUtils;
|
||||||
@ -103,7 +102,7 @@ public class TestSuiteResourceTest extends EntityResourceTest<TestSuite, CreateT
|
|||||||
|
|
||||||
public static ResultList<TestSuite> getTestSuites(Integer limit, String fields, Map<String, String> authHeaders)
|
public static ResultList<TestSuite> getTestSuites(Integer limit, String fields, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("testSuite");
|
WebTarget target = getResource("testSuite");
|
||||||
target = limit != null ? target.queryParam("limit", limit) : target;
|
target = limit != null ? target.queryParam("limit", limit) : target;
|
||||||
target = target.queryParam("fields", fields);
|
target = target.queryParam("fields", fields);
|
||||||
return TestUtils.get(target, TestSuiteResource.TestSuiteList.class, authHeaders);
|
return TestUtils.get(target, TestSuiteResource.TestSuiteList.class, authHeaders);
|
||||||
|
|||||||
@ -191,7 +191,7 @@ public class FeedResourceTest extends OpenMetadataApplicationTest {
|
|||||||
// Create thread without addressed to entity in the request
|
// Create thread without addressed to entity in the request
|
||||||
CreateThread create = create().withFrom(USER.getName()).withAbout("<>"); // Invalid EntityLink
|
CreateThread create = create().withFrom(USER.getName()).withAbout("<>"); // Invalid EntityLink
|
||||||
|
|
||||||
String failureReason = "[about must match \"^<#E::\\w+::[\\w'\\- .&/:+\"\\\\]+>$\"]";
|
String failureReason = "[about must match \"^<#E::\\w+::[\\w'\\- .&/:+\"\\\\()$#]+>$\"]";
|
||||||
assertResponseContains(() -> createThread(create, AUTH_HEADERS), BAD_REQUEST, failureReason);
|
assertResponseContains(() -> createThread(create, AUTH_HEADERS), BAD_REQUEST, failureReason);
|
||||||
|
|
||||||
create.withAbout("<#E::>"); // Invalid EntityLink - missing entityType and entityId
|
create.withAbout("<#E::>"); // Invalid EntityLink - missing entityType and entityId
|
||||||
|
|||||||
@ -190,7 +190,10 @@ public class GlossaryResourceTest extends EntityResourceTest<Glossary, CreateGlo
|
|||||||
List<TagLabel> tagLabels = toTagLabels(t1, t11, t12, t2, t21, t22);
|
List<TagLabel> tagLabels = toTagLabels(t1, t11, t12, t2, t21, t22);
|
||||||
Column column = new Column().withName(C1).withDataType(ColumnDataType.INT).withTags(tagLabels);
|
Column column = new Column().withName(C1).withDataType(ColumnDataType.INT).withTags(tagLabels);
|
||||||
CreateTable createTable =
|
CreateTable createTable =
|
||||||
tableResourceTest.createRequest(getEntityName(test)).withTags(tagLabels).withColumns(listOf(column));
|
tableResourceTest
|
||||||
|
.createRequest(tableResourceTest.getEntityName(test))
|
||||||
|
.withTags(tagLabels)
|
||||||
|
.withColumns(listOf(column));
|
||||||
Table table = tableResourceTest.createEntity(createTable, ADMIN_AUTH_HEADERS);
|
Table table = tableResourceTest.createEntity(createTable, ADMIN_AUTH_HEADERS);
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -247,7 +250,10 @@ public class GlossaryResourceTest extends EntityResourceTest<Glossary, CreateGlo
|
|||||||
List<TagLabel> tagLabels = toTagLabels(t1, t11, t111, t12, t121, t13, t131, t2, t21, t211, h1, h11, h111);
|
List<TagLabel> tagLabels = toTagLabels(t1, t11, t111, t12, t121, t13, t131, t2, t21, t211, h1, h11, h111);
|
||||||
Column column = new Column().withName(C1).withDataType(ColumnDataType.INT).withTags(tagLabels);
|
Column column = new Column().withName(C1).withDataType(ColumnDataType.INT).withTags(tagLabels);
|
||||||
CreateTable createTable =
|
CreateTable createTable =
|
||||||
tableResourceTest.createRequest(getEntityName(test)).withTags(tagLabels).withColumns(listOf(column));
|
tableResourceTest
|
||||||
|
.createRequest(tableResourceTest.getEntityName(test))
|
||||||
|
.withTags(tagLabels)
|
||||||
|
.withColumns(listOf(column));
|
||||||
Table table = tableResourceTest.createEntity(createTable, ADMIN_AUTH_HEADERS);
|
Table table = tableResourceTest.createEntity(createTable, ADMIN_AUTH_HEADERS);
|
||||||
|
|
||||||
Object[][] scenarios = {
|
Object[][] scenarios = {
|
||||||
@ -376,13 +382,13 @@ public class GlossaryResourceTest extends EntityResourceTest<Glossary, CreateGlo
|
|||||||
}
|
}
|
||||||
|
|
||||||
private CsvImportResult importCsv(String glossaryName, String csv, boolean dryRun) throws HttpResponseException {
|
private CsvImportResult importCsv(String glossaryName, String csv, boolean dryRun) throws HttpResponseException {
|
||||||
WebTarget target = getResourceByName(glossaryName + "/import");
|
WebTarget target = getResourceByName(glossaryName).path("/import");
|
||||||
target = !dryRun ? target.queryParam("dryRun", false) : target;
|
target = !dryRun ? target.queryParam("dryRun", false) : target;
|
||||||
return TestUtils.putCsv(target, csv, CsvImportResult.class, Status.OK, ADMIN_AUTH_HEADERS);
|
return TestUtils.putCsv(target, csv, CsvImportResult.class, Status.OK, ADMIN_AUTH_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String exportCsv(String glossaryName) throws HttpResponseException {
|
private String exportCsv(String glossaryName) throws HttpResponseException {
|
||||||
WebTarget target = getResourceByName(glossaryName + "/export");
|
WebTarget target = getResourceByName(glossaryName).path("/export");
|
||||||
return TestUtils.get(target, String.class, ADMIN_AUTH_HEADERS);
|
return TestUtils.get(target, String.class, ADMIN_AUTH_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -195,7 +195,8 @@ public class GlossaryTermResourceTest extends EntityResourceTest<GlossaryTerm, C
|
|||||||
|
|
||||||
// Apply each of the tag to a table
|
// Apply each of the tag to a table
|
||||||
TableResourceTest tableResourceTest = new TableResourceTest();
|
TableResourceTest tableResourceTest = new TableResourceTest();
|
||||||
CreateTable createTable = tableResourceTest.createRequest(getEntityName(test)).withTags(toTagLabels(a, aa, aaa));
|
CreateTable createTable =
|
||||||
|
tableResourceTest.createRequest(tableResourceTest.getEntityName(test)).withTags(toTagLabels(a, aa, aaa));
|
||||||
tableResourceTest.createEntity(createTable, ADMIN_AUTH_HEADERS);
|
tableResourceTest.createEntity(createTable, ADMIN_AUTH_HEADERS);
|
||||||
|
|
||||||
// Ensure prefix based tagLabel doesn't double count due too common prefix
|
// Ensure prefix based tagLabel doesn't double count due too common prefix
|
||||||
|
|||||||
@ -38,7 +38,6 @@ import org.openmetadata.schema.type.ChangeDescription;
|
|||||||
import org.openmetadata.schema.type.DataInsightChartDataType;
|
import org.openmetadata.schema.type.DataInsightChartDataType;
|
||||||
import org.openmetadata.schema.type.DataReportIndex;
|
import org.openmetadata.schema.type.DataReportIndex;
|
||||||
import org.openmetadata.service.Entity;
|
import org.openmetadata.service.Entity;
|
||||||
import org.openmetadata.service.OpenMetadataApplicationTest;
|
|
||||||
import org.openmetadata.service.resources.EntityResourceTest;
|
import org.openmetadata.service.resources.EntityResourceTest;
|
||||||
import org.openmetadata.service.resources.dataInsight.DataInsightResourceTest;
|
import org.openmetadata.service.resources.dataInsight.DataInsightResourceTest;
|
||||||
import org.openmetadata.service.util.ResultList;
|
import org.openmetadata.service.util.ResultList;
|
||||||
@ -188,15 +187,14 @@ public class KpiResourceTest extends EntityResourceTest<Kpi, CreateKpiRequest> {
|
|||||||
verifyKpiResults(kpiResults, kpiResultList, 12);
|
verifyKpiResults(kpiResults, kpiResultList, 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void putKpiResult(String fqn, KpiResult data, Map<String, String> authHeaders)
|
public void putKpiResult(String fqn, KpiResult data, Map<String, String> authHeaders) throws HttpResponseException {
|
||||||
throws HttpResponseException {
|
WebTarget target = getCollection().path("/" + fqn + "/kpiResult");
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("kpi/" + fqn + "/kpiResult");
|
|
||||||
TestUtils.put(target, data, CREATED, authHeaders);
|
TestUtils.put(target, data, CREATED, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResultList<KpiResult> getKpiResults(String fqn, Long start, Long end, Map<String, String> authHeaders)
|
public ResultList<KpiResult> getKpiResults(String fqn, Long start, Long end, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("kpi/" + fqn + "/kpiResult");
|
WebTarget target = getCollection().path("/" + fqn + "/kpiResult");
|
||||||
target = target.queryParam("startTs", start);
|
target = target.queryParam("startTs", start);
|
||||||
target = target.queryParam("endTs", end);
|
target = target.queryParam("endTs", end);
|
||||||
return TestUtils.get(target, KpiResource.KpiResultList.class, authHeaders);
|
return TestUtils.get(target, KpiResource.KpiResultList.class, authHeaders);
|
||||||
|
|||||||
@ -38,7 +38,6 @@ import org.openmetadata.schema.api.data.CreateLocation;
|
|||||||
import org.openmetadata.schema.entity.data.Location;
|
import org.openmetadata.schema.entity.data.Location;
|
||||||
import org.openmetadata.schema.type.EntityReference;
|
import org.openmetadata.schema.type.EntityReference;
|
||||||
import org.openmetadata.service.Entity;
|
import org.openmetadata.service.Entity;
|
||||||
import org.openmetadata.service.OpenMetadataApplicationTest;
|
|
||||||
import org.openmetadata.service.resources.EntityResourceTest;
|
import org.openmetadata.service.resources.EntityResourceTest;
|
||||||
import org.openmetadata.service.resources.locations.LocationResource.LocationList;
|
import org.openmetadata.service.resources.locations.LocationResource.LocationList;
|
||||||
import org.openmetadata.service.util.FullyQualifiedName;
|
import org.openmetadata.service.util.FullyQualifiedName;
|
||||||
@ -50,7 +49,8 @@ public class LocationResourceTest extends EntityResourceTest<Location, CreateLoc
|
|||||||
public LocationResourceTest() {
|
public LocationResourceTest() {
|
||||||
super(Entity.LOCATION, Location.class, LocationList.class, "locations", LocationResource.FIELDS);
|
super(Entity.LOCATION, Location.class, LocationList.class, "locations", LocationResource.FIELDS);
|
||||||
// TODO quoted location is not allowed by the Location listPrefix APIs
|
// TODO quoted location is not allowed by the Location listPrefix APIs
|
||||||
supportedNameCharacters = supportedNameCharacters.replaceAll("[ .]", ""); // Space not supported
|
// supportedNameCharacters = "_'-.";
|
||||||
|
supportedNameCharacters = supportedNameCharacters.replaceAll("[ &.]", ""); // Space not supported
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -100,8 +100,7 @@ public class LocationResourceTest extends EntityResourceTest<Location, CreateLoc
|
|||||||
}
|
}
|
||||||
|
|
||||||
private List<EntityReference> getAssociatedEntity(Location location) throws HttpResponseException {
|
private List<EntityReference> getAssociatedEntity(Location location) throws HttpResponseException {
|
||||||
WebTarget target =
|
WebTarget target = getResource(String.format("locations/association/%s", location.getId()));
|
||||||
OpenMetadataApplicationTest.getResource(String.format("locations/association/%s", location.getId()));
|
|
||||||
return (List<EntityReference>) TestUtils.get(target, List.class, ADMIN_AUTH_HEADERS);
|
return (List<EntityReference>) TestUtils.get(target, List.class, ADMIN_AUTH_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -60,8 +60,7 @@ public class TypeResourceTest extends EntityResourceTest<Type, CreateType> {
|
|||||||
super(Entity.TYPE, Type.class, TypeList.class, "metadata/types", TypeResource.PROPERTIES);
|
super(Entity.TYPE, Type.class, TypeList.class, "metadata/types", TypeResource.PROPERTIES);
|
||||||
supportsEmptyDescription = false;
|
supportsEmptyDescription = false;
|
||||||
supportsFieldsQueryParam = false;
|
supportsFieldsQueryParam = false;
|
||||||
// Special characters are not supported in the name
|
supportedNameCharacters = "_"; // No other special characters allowed
|
||||||
supportedNameCharacters = supportedNameCharacters.replaceAll("[ ':&/.]", "");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setupTypes() throws HttpResponseException {
|
public void setupTypes() throws HttpResponseException {
|
||||||
|
|||||||
@ -58,7 +58,6 @@ import org.openmetadata.schema.type.Status;
|
|||||||
import org.openmetadata.schema.type.StatusType;
|
import org.openmetadata.schema.type.StatusType;
|
||||||
import org.openmetadata.schema.type.Task;
|
import org.openmetadata.schema.type.Task;
|
||||||
import org.openmetadata.service.Entity;
|
import org.openmetadata.service.Entity;
|
||||||
import org.openmetadata.service.OpenMetadataApplicationTest;
|
|
||||||
import org.openmetadata.service.resources.EntityResourceTest;
|
import org.openmetadata.service.resources.EntityResourceTest;
|
||||||
import org.openmetadata.service.resources.pipelines.PipelineResource.PipelineList;
|
import org.openmetadata.service.resources.pipelines.PipelineResource.PipelineList;
|
||||||
import org.openmetadata.service.util.FullyQualifiedName;
|
import org.openmetadata.service.util.FullyQualifiedName;
|
||||||
@ -565,19 +564,19 @@ public class PipelineResourceTest extends EntityResourceTest<Pipeline, CreatePip
|
|||||||
// Prepare Pipeline status endpoint for PUT
|
// Prepare Pipeline status endpoint for PUT
|
||||||
public static Pipeline putPipelineStatusData(String fqn, PipelineStatus data, Map<String, String> authHeaders)
|
public static Pipeline putPipelineStatusData(String fqn, PipelineStatus data, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("pipelines/" + fqn + "/status");
|
WebTarget target = getResource("pipelines/" + fqn + "/status");
|
||||||
return TestUtils.put(target, data, Pipeline.class, OK, authHeaders);
|
return TestUtils.put(target, data, Pipeline.class, OK, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Pipeline deletePipelineStatus(String fqn, Long timestamp, Map<String, String> authHeaders)
|
public static Pipeline deletePipelineStatus(String fqn, Long timestamp, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("pipelines/" + fqn + "/status/" + timestamp);
|
WebTarget target = getResource("pipelines/" + fqn + "/status/" + timestamp);
|
||||||
return TestUtils.delete(target, Pipeline.class, authHeaders);
|
return TestUtils.delete(target, Pipeline.class, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResultList<PipelineStatus> getPipelineStatues(
|
public static ResultList<PipelineStatus> getPipelineStatues(
|
||||||
String fqn, Long startTs, Long endTs, Map<String, String> authHeaders) throws HttpResponseException {
|
String fqn, Long startTs, Long endTs, Map<String, String> authHeaders) throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("pipelines/" + fqn + "/status");
|
WebTarget target = getResource("pipelines/" + fqn + "/status");
|
||||||
target = target.queryParam("startTs", startTs).queryParam("endTs", endTs);
|
target = target.queryParam("startTs", startTs).queryParam("endTs", endTs);
|
||||||
return TestUtils.get(target, PipelineResource.PipelineStatusList.class, authHeaders);
|
return TestUtils.get(target, PipelineResource.PipelineStatusList.class, authHeaders);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -122,7 +122,7 @@ public class UserResourceTest extends EntityResourceTest<User, CreateUser> {
|
|||||||
|
|
||||||
public UserResourceTest() {
|
public UserResourceTest() {
|
||||||
super(Entity.USER, User.class, UserList.class, "users", UserResource.FIELDS);
|
super(Entity.USER, User.class, UserList.class, "users", UserResource.FIELDS);
|
||||||
supportedNameCharacters = supportedNameCharacters.replace(" ", ""); // Space not supported
|
supportedNameCharacters = "_-.";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setupUsers(TestInfo test) throws HttpResponseException {
|
public void setupUsers(TestInfo test) throws HttpResponseException {
|
||||||
|
|||||||
@ -54,7 +54,6 @@ import org.openmetadata.schema.type.TagLabel;
|
|||||||
import org.openmetadata.schema.type.topic.CleanupPolicy;
|
import org.openmetadata.schema.type.topic.CleanupPolicy;
|
||||||
import org.openmetadata.schema.type.topic.TopicSampleData;
|
import org.openmetadata.schema.type.topic.TopicSampleData;
|
||||||
import org.openmetadata.service.Entity;
|
import org.openmetadata.service.Entity;
|
||||||
import org.openmetadata.service.OpenMetadataApplicationTest;
|
|
||||||
import org.openmetadata.service.resources.EntityResourceTest;
|
import org.openmetadata.service.resources.EntityResourceTest;
|
||||||
import org.openmetadata.service.resources.topics.TopicResource.TopicList;
|
import org.openmetadata.service.resources.topics.TopicResource.TopicList;
|
||||||
import org.openmetadata.service.util.JsonUtils;
|
import org.openmetadata.service.util.JsonUtils;
|
||||||
@ -287,15 +286,14 @@ public class TopicResourceTest extends EntityResourceTest<Topic, CreateTopic> {
|
|||||||
return topic;
|
return topic;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Topic getTopic(UUID id, String fields, Map<String, String> authHeaders) throws HttpResponseException {
|
public Topic getTopic(UUID id, String fields, Map<String, String> authHeaders) throws HttpResponseException {
|
||||||
WebTarget target = getResource("topics/" + id);
|
WebTarget target = getResource(id);
|
||||||
target = fields != null ? target.queryParam("fields", fields) : target;
|
target = fields != null ? target.queryParam("fields", fields) : target;
|
||||||
return TestUtils.get(target, Topic.class, authHeaders);
|
return TestUtils.get(target, Topic.class, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Topic getTopicByName(String fqn, String fields, Map<String, String> authHeaders)
|
public Topic getTopicByName(String fqn, String fields, Map<String, String> authHeaders) throws HttpResponseException {
|
||||||
throws HttpResponseException {
|
WebTarget target = getResourceByName(fqn);
|
||||||
WebTarget target = getResource("topics/name/" + fqn);
|
|
||||||
target = fields != null ? target.queryParam("fields", fields) : target;
|
target = fields != null ? target.queryParam("fields", fields) : target;
|
||||||
return TestUtils.get(target, Topic.class, authHeaders);
|
return TestUtils.get(target, Topic.class, authHeaders);
|
||||||
}
|
}
|
||||||
@ -350,9 +348,9 @@ public class TopicResourceTest extends EntityResourceTest<Topic, CreateTopic> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Topic putSampleData(UUID topicId, TopicSampleData data, Map<String, String> authHeaders)
|
public Topic putSampleData(UUID topicId, TopicSampleData data, Map<String, String> authHeaders)
|
||||||
throws HttpResponseException {
|
throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("topics/" + topicId + "/sampleData");
|
WebTarget target = getResource(topicId).path("/sampleData");
|
||||||
return TestUtils.put(target, data, Topic.class, OK, authHeaders);
|
return TestUtils.put(target, data, Topic.class, OK, authHeaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -58,12 +58,12 @@ public class UtilResourceTest extends OpenMetadataApplicationTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static EntitiesCount getEntitiesCount() throws HttpResponseException {
|
public static EntitiesCount getEntitiesCount() throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("util/entities/count");
|
WebTarget target = getResource("util/entities/count");
|
||||||
return TestUtils.get(target, EntitiesCount.class, ADMIN_AUTH_HEADERS);
|
return TestUtils.get(target, EntitiesCount.class, ADMIN_AUTH_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ServicesCount getServicesCount() throws HttpResponseException {
|
public static ServicesCount getServicesCount() throws HttpResponseException {
|
||||||
WebTarget target = OpenMetadataApplicationTest.getResource("util/services/count");
|
WebTarget target = getResource("util/services/count");
|
||||||
return TestUtils.get(target, ServicesCount.class, ADMIN_AUTH_HEADERS);
|
return TestUtils.get(target, ServicesCount.class, ADMIN_AUTH_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"minLength": 1,
|
"minLength": 1,
|
||||||
"maxLength": 128,
|
"maxLength": 128,
|
||||||
"pattern": "^[\\w'\\- ./]+$"
|
"pattern": "^[\\w'\\- ./()$]+$"
|
||||||
},
|
},
|
||||||
"profileSampleType": {
|
"profileSampleType": {
|
||||||
"description": "Type of Profile Sample (percentage or rows)",
|
"description": "Type of Profile Sample (percentage or rows)",
|
||||||
@ -162,7 +162,7 @@
|
|||||||
"columnName": {
|
"columnName": {
|
||||||
"description": "Local name (not fully qualified name) of the column. ColumnName is `-` when the column is not named in struct dataType. For example, BigQuery supports struct with unnamed fields.",
|
"description": "Local name (not fully qualified name) of the column. ColumnName is `-` when the column is not named in struct dataType. For example, BigQuery supports struct with unnamed fields.",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"pattern": "^[\\w'\\-\" .+]+$",
|
"pattern": "^[\\w'\\-\" .+#]+$",
|
||||||
"minLength": 1,
|
"minLength": 1,
|
||||||
"maxLength": 128
|
"maxLength": 128
|
||||||
},
|
},
|
||||||
|
|||||||
@ -88,7 +88,7 @@
|
|||||||
"entityLink": {
|
"entityLink": {
|
||||||
"description": "Link to an entity or field within an entity using this format `<#E::{entities}::{entityType}::{field}::{arrayFieldName}::{arrayFieldValue}`.",
|
"description": "Link to an entity or field within an entity using this format `<#E::{entities}::{entityType}::{field}::{arrayFieldName}::{arrayFieldValue}`.",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"pattern": "^<#E::\\w+::[\\w'\\- .&/:+\"\\\\]+>$"
|
"pattern": "^<#E::\\w+::[\\w'\\- .&/:+\"\\\\()$#]+>$"
|
||||||
},
|
},
|
||||||
"entityName": {
|
"entityName": {
|
||||||
"description": "Name that identifies a entity.",
|
"description": "Name that identifies a entity.",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user