Remove public modifier for test methods(#1979) (#2039)

This commit is contained in:
mask 2022-01-05 19:34:14 +08:00 committed by GitHub
parent 9157511074
commit dea0f2117d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 282 additions and 282 deletions

View file

@ -30,7 +30,7 @@ public class EnumBackwardCompatibilityTest {
* number of the last enum. This will help catch new enum inadvertently being added in the middle.
*/
@Test
public void testRelationshipEnumBackwardCompatible() {
void testRelationshipEnumBackwardCompatible() {
assertEquals(15, Relationship.values().length);
assertEquals(14, Relationship.APPLIED_TO.ordinal());
}
@ -40,7 +40,7 @@ public class EnumBackwardCompatibilityTest {
* number of the last enum. This will help catch new enum inadvertently being added in the middle.
*/
@Test
public void testTagLabelEnumBackwardCompatible() {
void testTagLabelEnumBackwardCompatible() {
assertEquals(4, LabelType.values().length);
assertEquals(3, LabelType.DERIVED.ordinal());
}
@ -50,7 +50,7 @@ public class EnumBackwardCompatibilityTest {
* number of the last enum. This will help catch new enum inadvertently being added in the middle.
*/
@Test
public void testTagStateEnumBackwardCompatible() {
void testTagStateEnumBackwardCompatible() {
assertEquals(2, TagLabel.State.values().length);
assertEquals(1, State.CONFIRMED.ordinal());
}

View file

@ -21,7 +21,7 @@ import org.openmetadata.catalog.type.CollectionDescriptor;
public class CollectionRegistryTest {
@Test
public void testCollections() {
void testCollections() {
CollectionRegistry.getInstance();
Map<String, CollectionRegistry.CollectionDetails> descriptors = CollectionRegistry.getInstance().getCollectionMap();
String path = "/v1";

View file

@ -314,7 +314,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
// Common entity tests for GET operations
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@Test
public void get_entityListWithPagination_200(TestInfo test) throws HttpResponseException, URISyntaxException {
void get_entityListWithPagination_200(TestInfo test) throws HttpResponseException, URISyntaxException {
// Create a number of entities between 5 and 20 inclusive
Random rand = new Random();
int maxEntities = rand.nextInt(16) + 5;
@ -399,7 +399,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
}
@Test
public void get_entityListWithInvalidLimit_4xx() {
void get_entityListWithInvalidLimit_4xx() {
// Limit must be >= 1 and <= 1000,000
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> listEntities(null, -1, null, null, adminAuthHeaders()));
@ -414,7 +414,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
}
@Test
public void get_entityListWithInvalidPaginationCursors_4xx() {
void get_entityListWithInvalidPaginationCursors_4xx() {
// Passing both before and after cursors is invalid
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> listEntities(null, 1, "", "", adminAuthHeaders()));
@ -422,7 +422,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
}
@Test
public void get_entityWithDifferentFields_200_OK(TestInfo test) throws IOException, URISyntaxException {
void get_entityWithDifferentFields_200_OK(TestInfo test) throws IOException, URISyntaxException {
Object create = createRequest(getEntityName(test), "description", "displayName", USER_OWNER1);
T entity = createAndCheckEntity(create, adminAuthHeaders());
validateGetWithDifferentFields(entity, false);
@ -433,7 +433,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
// Common entity tests for POST operations
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@Test
public void post_entityCreateWithInvalidName_400() throws URISyntaxException {
void post_entityCreateWithInvalidName_400() throws URISyntaxException {
// Create an entity with mandatory name field null
final Object request = createRequest(null, "description", "displayName", null);
HttpResponseException exception =
@ -452,7 +452,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
}
@Test
public void post_chartWithInvalidOwnerType_4xx(TestInfo test) throws URISyntaxException {
void post_chartWithInvalidOwnerType_4xx(TestInfo test) throws URISyntaxException {
if (!supportsOwner) {
return;
}
@ -464,7 +464,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
}
@Test
public void post_entityWithNonExistentOwner_4xx(TestInfo test) throws URISyntaxException {
void post_entityWithNonExistentOwner_4xx(TestInfo test) throws URISyntaxException {
if (!supportsOwner) {
return;
}
@ -476,7 +476,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
}
@Test
public void post_entityAlreadyExists_409_conflict(TestInfo test) throws HttpResponseException, URISyntaxException {
void post_entityAlreadyExists_409_conflict(TestInfo test) throws HttpResponseException, URISyntaxException {
Object create = createRequest(getEntityName(test), "", "", null);
// Create first time using POST
createEntity(create, adminAuthHeaders());
@ -488,14 +488,14 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
// Common entity tests for PUT operations
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@Test
public void put_entityCreate_200(TestInfo test) throws IOException, URISyntaxException {
void put_entityCreate_200(TestInfo test) throws IOException, URISyntaxException {
// Create a new entity with PUT
Object request = createRequest(getEntityName(test), "description", "displayName", null);
updateAndCheckEntity(request, CREATED, adminAuthHeaders(), UpdateType.CREATED, null);
}
@Test
public void put_entityUpdateWithNoChange_200(TestInfo test) throws IOException, URISyntaxException {
void put_entityUpdateWithNoChange_200(TestInfo test) throws IOException, URISyntaxException {
// Create a chart with POST
Object request = createRequest(getEntityName(test), "description", "display", USER_OWNER1);
T entity = createAndCheckEntity(request, adminAuthHeaders());
@ -508,7 +508,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
}
@Test
public void put_entityCreate_as_owner_200(TestInfo test) throws IOException, URISyntaxException {
void put_entityCreate_as_owner_200(TestInfo test) throws IOException, URISyntaxException {
if (!supportsOwner) {
return; // Entity doesn't support ownership
}
@ -526,7 +526,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
}
@Test
public void put_entityUpdateOwner_200(TestInfo test) throws IOException, URISyntaxException {
void put_entityUpdateOwner_200(TestInfo test) throws IOException, URISyntaxException {
if (!supportsOwner) {
return; // Entity doesn't support ownership
}
@ -569,7 +569,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
}
@Test
public void put_entityNullDescriptionUpdate_200(TestInfo test) throws IOException, URISyntaxException {
void put_entityNullDescriptionUpdate_200(TestInfo test) throws IOException, URISyntaxException {
// Create entity with null description
Object request = createRequest(getEntityName(test), null, "displayName", null);
T entity = createAndCheckEntity(request, adminAuthHeaders());
@ -584,7 +584,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
}
@Test
public void put_entityEmptyDescriptionUpdate_200(TestInfo test) throws IOException, URISyntaxException {
void put_entityEmptyDescriptionUpdate_200(TestInfo test) throws IOException, URISyntaxException {
// Create entity with empty description
Object request = createRequest(getEntityName(test), "", "displayName", null);
T entity = createAndCheckEntity(request, adminAuthHeaders());
@ -600,7 +600,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
}
@Test
public void put_entityNonEmptyDescriptionUpdate_200(TestInfo test) throws IOException, URISyntaxException {
void put_entityNonEmptyDescriptionUpdate_200(TestInfo test) throws IOException, URISyntaxException {
// Create entity with non-empty description
Object request = createRequest(getEntityName(test), "description", "displayName", null);
T entity = createAndCheckEntity(request, adminAuthHeaders());
@ -616,7 +616,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
}
@Test
public void put_addDeleteFollower_200(TestInfo test) throws IOException, URISyntaxException {
void put_addDeleteFollower_200(TestInfo test) throws IOException, URISyntaxException {
if (!supportsFollowers) {
return; // Entity does not support following
}
@ -643,7 +643,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
}
@Test
public void put_addDeleteInvalidFollower_200(TestInfo test) throws IOException, URISyntaxException {
void put_addDeleteInvalidFollower_200(TestInfo test) throws IOException, URISyntaxException {
if (!supportsFollowers) {
return; // Entity does not support following
}
@ -670,7 +670,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
// Common entity tests for PATCH operations
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@Test
public void patch_entityAttributes_200_ok(TestInfo test) throws IOException, URISyntaxException {
void patch_entityAttributes_200_ok(TestInfo test) throws IOException, URISyntaxException {
if (!supportsPatch) {
return;
}
@ -772,7 +772,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
// Common entity tests for DELETE operations
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@Test
public void delete_nonExistentEntity_404() {
void delete_nonExistentEntity_404() {
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> deleteEntity(NON_EXISTENT_ENTITY, adminAuthHeaders()));
assertResponse(exception, NOT_FOUND, entityNotFound(entityName, NON_EXISTENT_ENTITY));
@ -782,7 +782,7 @@ public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
// Other tests
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@Test
public void testInvalidEntityList() {
void testInvalidEntityList() {
// Invalid entityCreated list
HttpResponseException exception =
assertThrows(

View file

@ -77,7 +77,7 @@ public class ChartResourceTest extends EntityResourceTest<Chart> {
}
@Test
public void post_validCharts_as_admin_200_OK(TestInfo test) throws IOException {
void post_validCharts_as_admin_200_OK(TestInfo test) throws IOException {
// Create team with different optional fields
CreateChart create =
create(test)
@ -92,17 +92,17 @@ public class ChartResourceTest extends EntityResourceTest<Chart> {
}
@Test
public void post_chartWithUserOwner_200_ok(TestInfo test) throws IOException {
void post_chartWithUserOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(USER_OWNER1), adminAuthHeaders());
}
@Test
public void post_chartWithTeamOwner_200_ok(TestInfo test) throws IOException {
void post_chartWithTeamOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(TEAM_OWNER1).withDisplayName("chart1"), adminAuthHeaders());
}
@Test
public void post_chart_as_non_admin_401(TestInfo test) {
void post_chart_as_non_admin_401(TestInfo test) {
CreateChart create = create(test);
assertResponse(
() -> createEntity(create, authHeaders("test@open-metadata.org")),
@ -111,7 +111,7 @@ public class ChartResourceTest extends EntityResourceTest<Chart> {
}
@Test
public void post_chartWithoutRequiredFields_4xx(TestInfo test) {
void post_chartWithoutRequiredFields_4xx(TestInfo test) {
// Service is required field
assertResponse(
() -> createEntity(create(test).withService(null), adminAuthHeaders()),
@ -120,7 +120,7 @@ public class ChartResourceTest extends EntityResourceTest<Chart> {
}
@Test
public void post_chartWithDifferentService_200_ok(TestInfo test) throws IOException {
void post_chartWithDifferentService_200_ok(TestInfo test) throws IOException {
EntityReference[] differentServices = {SUPERSET_REFERENCE, LOOKER_REFERENCE};
// Create chart for each service and test APIs
@ -142,13 +142,13 @@ public class ChartResourceTest extends EntityResourceTest<Chart> {
}
@Test
public void delete_emptyChart_200_ok(TestInfo test) throws HttpResponseException {
void delete_emptyChart_200_ok(TestInfo test) throws HttpResponseException {
Chart chart = createEntity(create(test), adminAuthHeaders());
deleteEntity(chart.getId(), adminAuthHeaders());
}
@Test
public void delete_nonEmptyChart_4xx() {
void delete_nonEmptyChart_4xx() {
// TODO
}

View file

@ -113,7 +113,7 @@ public class DashboardResourceTest extends EntityResourceTest<Dashboard> {
}
@Test
public void post_validDashboards_as_admin_200_OK(TestInfo test) throws IOException {
void post_validDashboards_as_admin_200_OK(TestInfo test) throws IOException {
// Create team with different optional fields
CreateDashboard create = create(test);
createAndCheckEntity(create, adminAuthHeaders());
@ -123,22 +123,22 @@ public class DashboardResourceTest extends EntityResourceTest<Dashboard> {
}
@Test
public void post_DashboardWithUserOwner_200_ok(TestInfo test) throws IOException {
void post_DashboardWithUserOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(USER_OWNER1), adminAuthHeaders());
}
@Test
public void post_DashboardWithTeamOwner_200_ok(TestInfo test) throws IOException {
void post_DashboardWithTeamOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(TEAM_OWNER1).withDisplayName("Dashboard1"), adminAuthHeaders());
}
@Test
public void post_DashboardWithCharts_200_ok(TestInfo test) throws IOException {
void post_DashboardWithCharts_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withCharts(CHART_REFERENCES), adminAuthHeaders());
}
@Test
public void post_Dashboard_as_non_admin_401(TestInfo test) {
void post_Dashboard_as_non_admin_401(TestInfo test) {
CreateDashboard create = create(test);
assertResponse(
() -> createDashboard(create, authHeaders("test@open-metadata.org")),
@ -147,14 +147,14 @@ public class DashboardResourceTest extends EntityResourceTest<Dashboard> {
}
@Test
public void post_DashboardWithoutRequiredService_4xx(TestInfo test) {
void post_DashboardWithoutRequiredService_4xx(TestInfo test) {
CreateDashboard create = create(test).withService(null);
TestUtils.assertResponseContains(
() -> createDashboard(create, adminAuthHeaders()), BAD_REQUEST, "service must not be null");
}
@Test
public void post_DashboardWithInvalidService_4xx(TestInfo test) {
void post_DashboardWithInvalidService_4xx(TestInfo test) {
CreateDashboard create = create(test).withService(SUPERSET_INVALID_SERVICE_REFERENCE);
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> createDashboard(create, adminAuthHeaders()));
@ -163,7 +163,7 @@ public class DashboardResourceTest extends EntityResourceTest<Dashboard> {
}
@Test
public void post_DashboardWithDifferentService_200_ok(TestInfo test) throws IOException {
void post_DashboardWithDifferentService_200_ok(TestInfo test) throws IOException {
EntityReference[] differentServices = {SUPERSET_REFERENCE, LOOKER_REFERENCE};
// Create Dashboard for each service and test APIs
@ -188,7 +188,7 @@ public class DashboardResourceTest extends EntityResourceTest<Dashboard> {
}
@Test
public void put_DashboardChartsUpdate_200(TestInfo test) throws IOException {
void put_DashboardChartsUpdate_200(TestInfo test) throws IOException {
CreateDashboard request = create(test).withService(SUPERSET_REFERENCE).withDescription(null);
Dashboard dashboard = createAndCheckEntity(request, adminAuthHeaders());
@ -206,7 +206,7 @@ public class DashboardResourceTest extends EntityResourceTest<Dashboard> {
}
@Test
public void put_AddRemoveDashboardChartsUpdate_200(TestInfo test) throws IOException {
void put_AddRemoveDashboardChartsUpdate_200(TestInfo test) throws IOException {
CreateDashboard request = create(test).withService(SUPERSET_REFERENCE).withDescription(null);
Dashboard dashboard = createAndCheckEntity(request, adminAuthHeaders());
@ -225,13 +225,13 @@ public class DashboardResourceTest extends EntityResourceTest<Dashboard> {
}
@Test
public void delete_emptyDashboard_200_ok(TestInfo test) throws HttpResponseException {
void delete_emptyDashboard_200_ok(TestInfo test) throws HttpResponseException {
Dashboard dashboard = createDashboard(create(test), adminAuthHeaders());
deleteEntity(dashboard.getId(), adminAuthHeaders());
}
@Test
public void delete_nonEmptyDashboard_4xx() {
void delete_nonEmptyDashboard_4xx() {
// TODO
}

View file

@ -57,7 +57,7 @@ public class DatabaseResourceTest extends EntityResourceTest<Database> {
}
@Test
public void post_validDatabases_as_admin_200_OK(TestInfo test) throws IOException {
void post_validDatabases_as_admin_200_OK(TestInfo test) throws IOException {
// Create team with different optional fields
CreateDatabase create = create(test);
createAndCheckEntity(create, adminAuthHeaders());
@ -67,7 +67,7 @@ public class DatabaseResourceTest extends EntityResourceTest<Database> {
}
@Test
public void post_databaseFQN_as_admin_200_OK(TestInfo test) throws IOException {
void post_databaseFQN_as_admin_200_OK(TestInfo test) throws IOException {
// Create team with different optional fields
CreateDatabase create = create(test);
create.setService(new EntityReference().withId(SNOWFLAKE_REFERENCE.getId()).withType("databaseService"));
@ -77,17 +77,17 @@ public class DatabaseResourceTest extends EntityResourceTest<Database> {
}
@Test
public void post_databaseWithUserOwner_200_ok(TestInfo test) throws IOException {
void post_databaseWithUserOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(USER_OWNER1), adminAuthHeaders());
}
@Test
public void post_databaseWithTeamOwner_200_ok(TestInfo test) throws IOException {
void post_databaseWithTeamOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(TEAM_OWNER1), adminAuthHeaders());
}
@Test
public void post_database_as_non_admin_401(TestInfo test) {
void post_database_as_non_admin_401(TestInfo test) {
CreateDatabase create = create(test);
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> createDatabase(create, authHeaders("test@open-metadata.org")));
@ -95,7 +95,7 @@ public class DatabaseResourceTest extends EntityResourceTest<Database> {
}
@Test
public void post_databaseWithoutRequiredService_4xx(TestInfo test) {
void post_databaseWithoutRequiredService_4xx(TestInfo test) {
CreateDatabase create = create(test).withService(null);
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> createDatabase(create, adminAuthHeaders()));
@ -103,7 +103,7 @@ public class DatabaseResourceTest extends EntityResourceTest<Database> {
}
@Test
public void post_databaseWithDifferentService_200_ok(TestInfo test) throws IOException {
void post_databaseWithDifferentService_200_ok(TestInfo test) throws IOException {
EntityReference[] differentServices = {
MYSQL_REFERENCE, REDSHIFT_REFERENCE, BIGQUERY_REFERENCE, SNOWFLAKE_REFERENCE
};
@ -127,13 +127,13 @@ public class DatabaseResourceTest extends EntityResourceTest<Database> {
}
@Test
public void delete_emptyDatabase_200_ok(TestInfo test) throws HttpResponseException {
void delete_emptyDatabase_200_ok(TestInfo test) throws HttpResponseException {
Database database = createDatabase(create(test), adminAuthHeaders());
deleteEntity(database.getId(), adminAuthHeaders());
}
@Test
public void delete_nonEmptyDatabase_4xx() {
void delete_nonEmptyDatabase_4xx() {
// TODO
}

View file

@ -135,7 +135,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void post_tableWithoutColumnDataLength_400(TestInfo test) {
void post_tableWithoutColumnDataLength_400(TestInfo test) {
List<Column> columns = singletonList(getColumn("c1", BIGINT, null).withOrdinalPosition(1));
CreateTable create = create(test).withColumns(columns);
@ -152,7 +152,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void post_tableInvalidArrayColumn_400(TestInfo test) {
void post_tableInvalidArrayColumn_400(TestInfo test) {
// No arrayDataType passed for array
List<Column> columns = singletonList(getColumn("c1", ARRAY, "array<int>", null));
CreateTable create = create(test).withColumns(columns);
@ -168,7 +168,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void post_duplicateColumnName_400(TestInfo test) {
void post_duplicateColumnName_400(TestInfo test) {
// Duplicate column names c1
String repeatedColumnName = "c1";
List<Column> columns =
@ -181,7 +181,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void post_validTables_200_OK(TestInfo test) throws IOException {
void post_validTables_200_OK(TestInfo test) throws IOException {
// Create table with different optional fields
// Optional field description
CreateTable create = create(test).withDescription("description");
@ -212,7 +212,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void post_put_patch_complexColumnTypes(TestInfo test) throws IOException {
void post_put_patch_complexColumnTypes(TestInfo test) throws IOException {
Column c1 = getColumn("c1", ARRAY, "array<int>", USER_ADDRESS_TAG_LABEL).withArrayDataType(INT);
Column c2_a = getColumn("a", INT, USER_ADDRESS_TAG_LABEL);
Column c2_b = getColumn("b", CHAR, USER_ADDRESS_TAG_LABEL);
@ -315,17 +315,17 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void post_tableWithUserOwner_200_ok(TestInfo test) throws IOException {
void post_tableWithUserOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(USER_OWNER1), adminAuthHeaders());
}
@Test
public void post_tableWithTeamOwner_200_ok(TestInfo test) throws IOException {
void post_tableWithTeamOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(TEAM_OWNER1), adminAuthHeaders());
}
@Test
public void post_tableWithInvalidDatabase_404(TestInfo test) {
void post_tableWithInvalidDatabase_404(TestInfo test) {
CreateTable create = create(test).withDatabase(NON_EXISTENT_ENTITY);
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> createEntity(create, adminAuthHeaders()));
@ -333,7 +333,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void post_table_as_non_admin_401(TestInfo test) {
void post_table_as_non_admin_401(TestInfo test) {
CreateTable create = create(test);
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> createEntity(create, authHeaders("test@open-metadata.org")));
@ -341,7 +341,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void put_tableTableConstraintUpdate_200(TestInfo test) throws IOException {
void put_tableTableConstraintUpdate_200(TestInfo test) throws IOException {
// Create table without table constraints
CreateTable request = create(test).withOwner(USER_OWNER1).withDescription("description").withTableConstraints(null);
Table table = createAndCheckEntity(request, adminAuthHeaders());
@ -378,7 +378,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void put_columnConstraintUpdate_200(TestInfo test) throws IOException {
void put_columnConstraintUpdate_200(TestInfo test) throws IOException {
List<Column> columns = new ArrayList<>();
columns.add(getColumn("c1", INT, null).withConstraint(ColumnConstraint.NULL));
columns.add(getColumn("c2", INT, null).withConstraint(ColumnConstraint.UNIQUE));
@ -422,7 +422,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void put_updateColumns_200(TestInfo test) throws IOException {
void put_updateColumns_200(TestInfo test) throws IOException {
int tagCategoryUsageCount = getTagCategoryUsageCount("user", userAuthHeaders());
int addressTagUsageCount = getTagUsageCount(USER_ADDRESS_TAG_LABEL.getTagFQN(), userAuthHeaders());
int bankTagUsageCount = getTagUsageCount(USER_BANK_ACCOUNT_TAG_LABEL.getTagFQN(), userAuthHeaders());
@ -494,7 +494,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void put_tableJoins_200(TestInfo test) throws IOException, ParseException {
void put_tableJoins_200(TestInfo test) throws IOException, ParseException {
Table table1 = createAndCheckEntity(create(test, 1), adminAuthHeaders());
Table table2 = createAndCheckEntity(create(test, 2), adminAuthHeaders());
Table table3 = createAndCheckEntity(create(test, 3), adminAuthHeaders());
@ -616,7 +616,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void put_tableJoinsInvalidColumnName_4xx(TestInfo test) throws IOException, ParseException {
void put_tableJoinsInvalidColumnName_4xx(TestInfo test) throws IOException, ParseException {
Table table1 = createAndCheckEntity(create(test, 1), adminAuthHeaders());
Table table2 = createAndCheckEntity(create(test, 2), adminAuthHeaders());
@ -672,7 +672,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void put_tableSampleData_200(TestInfo test) throws IOException {
void put_tableSampleData_200(TestInfo test) throws IOException {
Table table = createAndCheckEntity(create(test), adminAuthHeaders());
List<String> columns = Arrays.asList("c1", "c2", "c3");
@ -692,7 +692,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void put_tableInvalidSampleData_4xx(TestInfo test) throws IOException {
void put_tableInvalidSampleData_4xx(TestInfo test) throws IOException {
Table table = createAndCheckEntity(create(test), adminAuthHeaders());
TableData tableData = new TableData();
@ -722,7 +722,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void put_viewDefinition_200(TestInfo test) throws IOException {
void put_viewDefinition_200(TestInfo test) throws IOException {
CreateTable createTable = create(test);
createTable.setTableType(TableType.View);
String query =
@ -740,7 +740,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void put_viewDefinition_invalid_table_4xx(TestInfo test) {
void put_viewDefinition_invalid_table_4xx(TestInfo test) {
CreateTable createTable = create(test);
createTable.setTableType(TableType.Regular);
String query =
@ -760,7 +760,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void put_tableProfile_200(TestInfo test) throws IOException {
void put_tableProfile_200(TestInfo test) throws IOException {
Table table = createAndCheckEntity(create(test), adminAuthHeaders());
ColumnProfile c1Profile =
new ColumnProfile().withName("c1").withMax("100.0").withMin("10.0").withUniqueCount(100.0);
@ -811,7 +811,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void put_tableInvalidTableProfileData_4xx(TestInfo test) throws IOException {
void put_tableInvalidTableProfileData_4xx(TestInfo test) throws IOException {
Table table = createAndCheckEntity(create(test), adminAuthHeaders());
ColumnProfile c1Profile = new ColumnProfile().withName("c1").withMax("100").withMin("10.0").withUniqueCount(100.0);
@ -832,7 +832,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void put_tableQueries_200(TestInfo test) throws IOException {
void put_tableQueries_200(TestInfo test) throws IOException {
Table table = createAndCheckEntity(create(test), adminAuthHeaders());
SQLQuery query = new SQLQuery().withQuery("select * from test;").withQueryDate("2021-09-08").withDuration(600.0);
Table putResponse = putTableQueriesData(table.getId(), query, adminAuthHeaders());
@ -876,7 +876,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void put_tableDataModel(TestInfo test) throws IOException {
void put_tableDataModel(TestInfo test) throws IOException {
List<Column> columns =
Arrays.asList(
getColumn("c1", BIGINT, USER_ADDRESS_TAG_LABEL).withDescription(null),
@ -929,7 +929,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
@Test
@Order(1) // Run this test first as other tables created in other tests will interfere with listing
public void get_tableListWithDifferentFields_200_OK(TestInfo test) throws IOException {
void get_tableListWithDifferentFields_200_OK(TestInfo test) throws IOException {
CreateTable create =
create(test, 1)
.withDescription("description")
@ -1018,13 +1018,13 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void delete_table_200_ok(TestInfo test) throws HttpResponseException {
void delete_table_200_ok(TestInfo test) throws HttpResponseException {
Table table = createEntity(create(test), adminAuthHeaders());
deleteEntity(table.getId(), adminAuthHeaders());
}
@Test
public void delete_table_as_non_admin_401(TestInfo test) throws HttpResponseException {
void delete_table_as_non_admin_401(TestInfo test) throws HttpResponseException {
Table table = createEntity(create(test), adminAuthHeaders());
HttpResponseException exception =
assertThrows(
@ -1037,7 +1037,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
* description, owner, and tags
*/
@Test
public void patch_tableAttributes_200_ok(TestInfo test) throws IOException {
void patch_tableAttributes_200_ok(TestInfo test) throws IOException {
// Create table without tableType, and tableConstraints
Table table = createEntity(create(test).withTableConstraints(null), adminAuthHeaders());
@ -1093,7 +1093,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void patch_tableColumns_200_ok(TestInfo test) throws IOException {
void patch_tableColumns_200_ok(TestInfo test) throws IOException {
// Create table with the following columns
List<Column> columns = new ArrayList<>();
columns.add(getColumn("c1", INT, USER_ADDRESS_TAG_LABEL).withDescription(null));
@ -1146,7 +1146,7 @@ public class TableResourceTest extends EntityResourceTest<Table> {
}
@Test
public void put_addDeleteLocation_200(TestInfo test) throws IOException {
void put_addDeleteLocation_200(TestInfo test) throws IOException {
Table table = createAndCheckEntity(create(test), adminAuthHeaders());
// Add location to the table

View file

@ -66,7 +66,7 @@ public class WebhookResourceTest extends EntityResourceTest<Webhook> {
}
@Test
public void post_webhookEnabledStateChange(TestInfo test)
void post_webhookEnabledStateChange(TestInfo test)
throws URISyntaxException, IOException, InterruptedException {
//
// Create webhook in disabled state. It will not start webhook publisher
@ -140,7 +140,7 @@ public class WebhookResourceTest extends EntityResourceTest<Webhook> {
}
@Test
public void put_updateEndpointURL(TestInfo test) throws URISyntaxException, IOException, InterruptedException {
void put_updateEndpointURL(TestInfo test) throws URISyntaxException, IOException, InterruptedException {
CreateWebhook create =
createRequest("counter", "", "", null).withEnabled(true).withEndpoint(URI.create("http://invalidUnknowHost"));
Webhook webhook = createAndCheckEntity(create, adminAuthHeaders());
@ -295,7 +295,7 @@ public class WebhookResourceTest extends EntityResourceTest<Webhook> {
}
@Test
public void testDifferentTypesOfWebhooks() throws IOException, InterruptedException, URISyntaxException {
void testDifferentTypesOfWebhooks() throws IOException, InterruptedException, URISyntaxException {
String baseUri = "http://localhost:" + APP.getLocalPort() + "/api/v1/test/webhook";
// Create multiple webhooks each with different type of response to callback

View file

@ -81,7 +81,7 @@ public class FeedResourceTest extends CatalogApplicationTest {
}
@Test
public void post_feedWithoutAbout_4xx() {
void post_feedWithoutAbout_4xx() {
// Create thread without addressed to entity in the request
CreateThread create = create().withFrom(USER.getId()).withAbout(null);
HttpResponseException exception =
@ -90,7 +90,7 @@ public class FeedResourceTest extends CatalogApplicationTest {
}
@Test
public void post_feedWithInvalidAbout_4xx() {
void post_feedWithInvalidAbout_4xx() {
// Create thread without addressed to entity in the request
CreateThread create = create().withFrom(USER.getId()).withAbout("<>"); // Invalid EntityLink
Map<String, String> authHeaders = authHeaders(USER.getEmail());
@ -112,7 +112,7 @@ public class FeedResourceTest extends CatalogApplicationTest {
}
@Test
public void post_feedWithoutMessage_4xx() {
void post_feedWithoutMessage_4xx() {
// Create thread without message field in the request
CreateThread create = create().withFrom(USER.getId()).withMessage(null);
HttpResponseException exception =
@ -121,7 +121,7 @@ public class FeedResourceTest extends CatalogApplicationTest {
}
@Test
public void post_feedWithoutFrom_4xx() {
void post_feedWithoutFrom_4xx() {
// Create thread without from field in the request
CreateThread create = create().withFrom(null);
HttpResponseException exception =
@ -130,7 +130,7 @@ public class FeedResourceTest extends CatalogApplicationTest {
}
@Test
public void post_feedWithNonExistentFrom_404() {
void post_feedWithNonExistentFrom_404() {
// Create thread with non-existent from
CreateThread create = create().withFrom(TestUtils.NON_EXISTENT_ENTITY);
HttpResponseException exception =
@ -139,7 +139,7 @@ public class FeedResourceTest extends CatalogApplicationTest {
}
@Test
public void post_feedWithNonExistentAbout_404() {
void post_feedWithNonExistentAbout_404() {
// Create thread with non-existent addressed To entity
CreateThread create = create().withAbout("<#E/table/invalidTableName>");
HttpResponseException exception =
@ -148,7 +148,7 @@ public class FeedResourceTest extends CatalogApplicationTest {
}
@Test
public void post_validThreadAndList_200(TestInfo test) throws HttpResponseException {
void post_validThreadAndList_200(TestInfo test) throws HttpResponseException {
int totalThreadCount = listThreads(null, adminAuthHeaders()).getData().size();
int userThreadCount = listThreads(USER_LINK, adminAuthHeaders()).getData().size();
int teamThreadCount = listThreads(TEAM_LINK, adminAuthHeaders()).getData().size();
@ -173,7 +173,7 @@ public class FeedResourceTest extends CatalogApplicationTest {
}
@Test
public void post_addPostWithoutMessage_4xx() {
void post_addPostWithoutMessage_4xx() {
// Add post to a thread without message field
Post post = createPost().withMessage(null);
HttpResponseException exception =
@ -182,7 +182,7 @@ public class FeedResourceTest extends CatalogApplicationTest {
}
@Test
public void post_addPostWithoutFrom_4xx() {
void post_addPostWithoutFrom_4xx() {
// Add post to a thread without from field
Post post = createPost().withFrom(null);
HttpResponseException exception =
@ -191,7 +191,7 @@ public class FeedResourceTest extends CatalogApplicationTest {
}
@Test
public void post_addPostWithNonExistentFrom_404() {
void post_addPostWithNonExistentFrom_404() {
// Add post to a thread with non-existent from user
Post post = createPost().withFrom(TestUtils.NON_EXISTENT_ENTITY);
HttpResponseException exception =
@ -200,7 +200,7 @@ public class FeedResourceTest extends CatalogApplicationTest {
}
@Test
public void post_validAddPost_200() throws HttpResponseException {
void post_validAddPost_200() throws HttpResponseException {
Map<String, String> authHeaders = authHeaders(USER.getEmail());
Thread thread = createAndCheck(create(), authHeaders);
// Add 10 posts and validate

View file

@ -21,7 +21,7 @@ import org.openmetadata.catalog.resources.feeds.MessageParser.EntityLink;
public class MessageParserTest {
@Test
public void parseMessage() {
void parseMessage() {
String s =
"abcd <angle1> <angle2> <angle3> "
+ // Text in angled brackets that are not entity links

View file

@ -62,7 +62,7 @@ public class LineageResourceTest extends CatalogApplicationTest {
}
@Test
public void put_addLineageForInvalidEntities() throws HttpResponseException {
void put_addLineageForInvalidEntities() throws HttpResponseException {
// Add lineage table4-->table5
addEdge(TABLES.get(4), TABLES.get(5));

View file

@ -124,7 +124,7 @@ public class LocationResourceTest extends EntityResourceTest<Location> {
}
@Test
public void get_locationListWithPrefix_2xx(TestInfo test) throws HttpResponseException {
void get_locationListWithPrefix_2xx(TestInfo test) throws HttpResponseException {
// Create some nested locations.
List<String> paths = Arrays.asList("/" + test.getDisplayName(), "/dwh", "/catalog", "/schema", "/table");
String locationName =
@ -155,7 +155,7 @@ public class LocationResourceTest extends EntityResourceTest<Location> {
}
@Test
public void post_validLocations_as_admin_200_OK(TestInfo test) throws IOException {
void post_validLocations_as_admin_200_OK(TestInfo test) throws IOException {
// Create team with different optional fields
CreateLocation create = create(test);
createAndCheckEntity(create, adminAuthHeaders());
@ -165,17 +165,17 @@ public class LocationResourceTest extends EntityResourceTest<Location> {
}
@Test
public void post_locationWithUserOwner_200_ok(TestInfo test) throws IOException {
void post_locationWithUserOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(USER_OWNER1), adminAuthHeaders());
}
@Test
public void post_locationWithTeamOwner_200_ok(TestInfo test) throws IOException {
void post_locationWithTeamOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(TEAM_OWNER1), adminAuthHeaders());
}
@Test
public void post_location_as_non_admin_401(TestInfo test) {
void post_location_as_non_admin_401(TestInfo test) {
CreateLocation create = create(test);
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> createLocation(create, authHeaders("test@open-metadata.org")));
@ -183,13 +183,13 @@ public class LocationResourceTest extends EntityResourceTest<Location> {
}
@Test
public void delete_location_200_ok(TestInfo test) throws HttpResponseException {
void delete_location_200_ok(TestInfo test) throws HttpResponseException {
Location location = createLocation(create(test), adminAuthHeaders());
deleteEntity(location.getId(), adminAuthHeaders());
}
@Test
public void delete_location_as_non_admin_401(TestInfo test) throws HttpResponseException {
void delete_location_as_non_admin_401(TestInfo test) throws HttpResponseException {
Location location = createLocation(create(test), adminAuthHeaders());
HttpResponseException exception =
assertThrows(
@ -198,7 +198,7 @@ public class LocationResourceTest extends EntityResourceTest<Location> {
}
@Test
public void post_locationWithoutRequiredFields_4xx(TestInfo test) {
void post_locationWithoutRequiredFields_4xx(TestInfo test) {
HttpResponseException exception =
assertThrows(
HttpResponseException.class, () -> createLocation(create(test).withName(null), adminAuthHeaders()));
@ -212,7 +212,7 @@ public class LocationResourceTest extends EntityResourceTest<Location> {
}
@Test
public void post_locationWithDifferentService_200_ok(TestInfo test) throws IOException {
void post_locationWithDifferentService_200_ok(TestInfo test) throws IOException {
EntityReference[] differentServices = {GCP_STORAGE_SERVICE_REFERENCE, AWS_STORAGE_SERVICE_REFERENCE};
// Create location for each service and test APIs
@ -234,7 +234,7 @@ public class LocationResourceTest extends EntityResourceTest<Location> {
}
@Test
public void put_locationNonEmptyDescriptionUpdate_200(TestInfo test) throws IOException {
void put_locationNonEmptyDescriptionUpdate_200(TestInfo test) throws IOException {
CreateLocation request = create(test).withService(AWS_STORAGE_SERVICE_REFERENCE).withDescription("description");
createAndCheckEntity(request, adminAuthHeaders());

View file

@ -157,7 +157,7 @@ public class MlModelResourceTest extends EntityResourceTest<MlModel> {
}
@Test
public void post_validMlModels_as_admin_200_OK(TestInfo test) throws IOException {
void post_validMlModels_as_admin_200_OK(TestInfo test) throws IOException {
// Create valid model
CreateMlModel create = create(test);
createAndCheckEntity(create, adminAuthHeaders());
@ -167,41 +167,41 @@ public class MlModelResourceTest extends EntityResourceTest<MlModel> {
}
@Test
public void post_MlModelWithUserOwner_200_ok(TestInfo test) throws IOException {
void post_MlModelWithUserOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(USER_OWNER1), adminAuthHeaders());
}
@Test
public void post_MlModelWithTeamOwner_200_ok(TestInfo test) throws IOException {
void post_MlModelWithTeamOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(TEAM_OWNER1).withDisplayName("Model1"), adminAuthHeaders());
}
@Test
public void post_MlModelWithoutFeatures_200_ok(TestInfo test) throws IOException {
void post_MlModelWithoutFeatures_200_ok(TestInfo test) throws IOException {
CreateMlModel create = new CreateMlModel().withName(getEntityName(test, 0)).withAlgorithm(ALGORITHM);
createAndCheckEntity(create, adminAuthHeaders());
}
@Test
public void post_MlModelWithDashboard_200_ok(TestInfo test) throws IOException {
void post_MlModelWithDashboard_200_ok(TestInfo test) throws IOException {
CreateMlModel create = create(test).withDashboard(DASHBOARD_REFERENCE);
createAndCheckEntity(create, adminAuthHeaders());
}
@Test
public void post_MlModelWitMlStore_200_ok(TestInfo test) throws IOException {
void post_MlModelWitMlStore_200_ok(TestInfo test) throws IOException {
CreateMlModel create = create(test).withMlStore(ML_STORE);
createAndCheckEntity(create, adminAuthHeaders());
}
@Test
public void post_MlModelWitServer_200_ok(TestInfo test) throws IOException {
void post_MlModelWitServer_200_ok(TestInfo test) throws IOException {
CreateMlModel create = create(test).withServer(SERVER);
createAndCheckEntity(create, adminAuthHeaders());
}
@Test
public void post_MlModel_as_non_admin_401(TestInfo test) {
void post_MlModel_as_non_admin_401(TestInfo test) {
CreateMlModel create = create(test);
assertResponse(
() -> createMlModel(create, authHeaders("test@open-metadata.org")),
@ -210,7 +210,7 @@ public class MlModelResourceTest extends EntityResourceTest<MlModel> {
}
@Test
public void put_MlModelUpdateWithNoChange_200(TestInfo test) throws IOException {
void put_MlModelUpdateWithNoChange_200(TestInfo test) throws IOException {
// Create a Model with POST
CreateMlModel request = create(test).withOwner(USER_OWNER1);
MlModel model = createAndCheckEntity(request, adminAuthHeaders());
@ -221,7 +221,7 @@ public class MlModelResourceTest extends EntityResourceTest<MlModel> {
}
@Test
public void put_MlModelUpdateAlgorithm_200(TestInfo test) throws IOException {
void put_MlModelUpdateAlgorithm_200(TestInfo test) throws IOException {
CreateMlModel request = create(test);
MlModel model = createAndCheckEntity(request, adminAuthHeaders());
ChangeDescription change = getChangeDescription(model.getVersion());
@ -233,7 +233,7 @@ public class MlModelResourceTest extends EntityResourceTest<MlModel> {
}
@Test
public void put_MlModelAddDashboard_200(TestInfo test) throws IOException {
void put_MlModelAddDashboard_200(TestInfo test) throws IOException {
CreateMlModel request = create(test);
MlModel model = createAndCheckEntity(request, adminAuthHeaders());
ChangeDescription change = getChangeDescription(model.getVersion());
@ -244,7 +244,7 @@ public class MlModelResourceTest extends EntityResourceTest<MlModel> {
}
@Test
public void put_MlModelAddInvalidDashboard_200(TestInfo test) {
void put_MlModelAddInvalidDashboard_200(TestInfo test) {
CreateMlModel request = create(test);
// Create a made up dashboard reference by picking up a random UUID
EntityReference dashboard = new EntityReference().withId(USER1.getId()).withType("dashboard");
@ -256,7 +256,7 @@ public class MlModelResourceTest extends EntityResourceTest<MlModel> {
}
@Test
public void put_MlModelAddServer_200(TestInfo test) throws IOException {
void put_MlModelAddServer_200(TestInfo test) throws IOException {
CreateMlModel request = create(test);
MlModel model = createAndCheckEntity(request, adminAuthHeaders());
ChangeDescription change = getChangeDescription(model.getVersion());
@ -266,7 +266,7 @@ public class MlModelResourceTest extends EntityResourceTest<MlModel> {
}
@Test
public void put_MlModelUpdateServer_200(TestInfo test) throws IOException {
void put_MlModelUpdateServer_200(TestInfo test) throws IOException {
CreateMlModel request = create(test).withServer(SERVER);
MlModel model = createAndCheckEntity(request, adminAuthHeaders());
ChangeDescription change = getChangeDescription(model.getVersion());
@ -278,7 +278,7 @@ public class MlModelResourceTest extends EntityResourceTest<MlModel> {
}
@Test
public void put_MlModelAddMlStore_200(TestInfo test) throws IOException {
void put_MlModelAddMlStore_200(TestInfo test) throws IOException {
CreateMlModel request = create(test);
MlModel model = createAndCheckEntity(request, adminAuthHeaders());
ChangeDescription change = getChangeDescription(model.getVersion());
@ -288,7 +288,7 @@ public class MlModelResourceTest extends EntityResourceTest<MlModel> {
}
@Test
public void put_MlModelAddMlFeatures_200(TestInfo test) throws IOException {
void put_MlModelAddMlFeatures_200(TestInfo test) throws IOException {
CreateMlModel request = new CreateMlModel().withName(getEntityName(test)).withAlgorithm(ALGORITHM);
MlModel model = createAndCheckEntity(request, adminAuthHeaders());
ChangeDescription change = getChangeDescription(model.getVersion());
@ -298,7 +298,7 @@ public class MlModelResourceTest extends EntityResourceTest<MlModel> {
}
@Test
public void put_MlModelUpdateMlFeatures_200(TestInfo test) throws IOException {
void put_MlModelUpdateMlFeatures_200(TestInfo test) throws IOException {
CreateMlModel request = create(test);
MlModel model = createAndCheckEntity(request, adminAuthHeaders());
@ -316,7 +316,7 @@ public class MlModelResourceTest extends EntityResourceTest<MlModel> {
}
@Test
public void put_MlModelWithDataSource_200(TestInfo test) throws IOException {
void put_MlModelWithDataSource_200(TestInfo test) throws IOException {
CreateMlModel request = create(test);
MlModel model = createAndCheckEntity(request, adminAuthHeaders());
@ -340,7 +340,7 @@ public class MlModelResourceTest extends EntityResourceTest<MlModel> {
}
@Test
public void put_MlModelWithInvalidDataSource_400(TestInfo test) throws IOException {
void put_MlModelWithInvalidDataSource_400(TestInfo test) throws IOException {
CreateMlModel request = create(test);
// Create a made up table reference by picking up a random UUID
@ -365,7 +365,7 @@ public class MlModelResourceTest extends EntityResourceTest<MlModel> {
}
@Test
public void put_MlModelAddMlHyperParams_200(TestInfo test) throws IOException {
void put_MlModelAddMlHyperParams_200(TestInfo test) throws IOException {
CreateMlModel request = new CreateMlModel().withName(getEntityName(test)).withAlgorithm(ALGORITHM);
MlModel model = createAndCheckEntity(request, adminAuthHeaders());
ChangeDescription change = getChangeDescription(model.getVersion());
@ -376,7 +376,7 @@ public class MlModelResourceTest extends EntityResourceTest<MlModel> {
}
@Test
public void delete_MlModel_200_ok(TestInfo test) throws HttpResponseException {
void delete_MlModel_200_ok(TestInfo test) throws HttpResponseException {
MlModel model = createMlModel(create(test), adminAuthHeaders());
deleteEntity(model.getId(), adminAuthHeaders());
}

View file

@ -132,7 +132,7 @@ public class IngestionResourceTest extends EntityOperationsResourceTest<Ingestio
}
@Test
public void post_validIngestion_as_admin_200_OK(TestInfo test) throws IOException {
void post_validIngestion_as_admin_200_OK(TestInfo test) throws IOException {
// Create team with different optional fields
CreateIngestion create = create(test);
createAndCheckEntity(create, adminAuthHeaders());
@ -142,22 +142,22 @@ public class IngestionResourceTest extends EntityOperationsResourceTest<Ingestio
}
@Test
public void post_IngestionWithUserOwner_200_ok(TestInfo test) throws IOException {
void post_IngestionWithUserOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(USER_OWNER1), adminAuthHeaders());
}
@Test
public void post_IngestionWithTeamOwner_200_ok(TestInfo test) throws IOException {
void post_IngestionWithTeamOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(TEAM_OWNER1).withDisplayName("Ingestion1"), adminAuthHeaders());
}
@Test
public void post_IngestionWithConfig_200_ok(TestInfo test) throws IOException {
void post_IngestionWithConfig_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withConnectorConfig(INGESTION_CONFIG), adminAuthHeaders());
}
@Test
public void post_Ingestion_as_non_admin_401(TestInfo test) {
void post_Ingestion_as_non_admin_401(TestInfo test) {
CreateIngestion create = create(test);
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> createEntity(create, authHeaders("test@open-metadata.org")));
@ -165,7 +165,7 @@ public class IngestionResourceTest extends EntityOperationsResourceTest<Ingestio
}
@Test
public void post_IngestionWithoutRequiredService_4xx(TestInfo test) {
void post_IngestionWithoutRequiredService_4xx(TestInfo test) {
CreateIngestion create = create(test).withService(null);
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> createEntity(create, adminAuthHeaders()));
@ -173,7 +173,7 @@ public class IngestionResourceTest extends EntityOperationsResourceTest<Ingestio
}
@Test
public void post_IngestionWithDeploy_4xx(TestInfo test) {
void post_IngestionWithDeploy_4xx(TestInfo test) {
CreateIngestion create = create(test).withService(BIGQUERY_REFERENCE).withForceDeploy(true);
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> createEntity(create, adminAuthHeaders()));
@ -181,7 +181,7 @@ public class IngestionResourceTest extends EntityOperationsResourceTest<Ingestio
}
@Test
public void post_IngestionWithDifferentService_200_ok(TestInfo test) throws IOException {
void post_IngestionWithDifferentService_200_ok(TestInfo test) throws IOException {
EntityReference[] differentServices = {REDSHIFT_REFERENCE, BIGQUERY_REFERENCE};
// Create Ingestion for each service and test APIs
@ -192,7 +192,7 @@ public class IngestionResourceTest extends EntityOperationsResourceTest<Ingestio
}
@Test
public void put_IngestionUrlUpdate_200(TestInfo test) throws IOException {
void put_IngestionUrlUpdate_200(TestInfo test) throws IOException {
CreateIngestion request =
create(test)
.withService(new EntityReference().withId(BIGQUERY_REFERENCE.getId()).withType("databaseService"))
@ -222,7 +222,7 @@ public class IngestionResourceTest extends EntityOperationsResourceTest<Ingestio
}
@Test
public void put_IngestionUpdate_200(TestInfo test) throws IOException {
void put_IngestionUpdate_200(TestInfo test) throws IOException {
CreateIngestion request = create(test).withService(BIGQUERY_REFERENCE).withDescription(null).withOwner(null);
Ingestion ingestion = createAndCheckEntity(request, adminAuthHeaders());
@ -235,13 +235,13 @@ public class IngestionResourceTest extends EntityOperationsResourceTest<Ingestio
}
@Test
public void delete_ingestion_200_ok(TestInfo test) throws HttpResponseException {
void delete_ingestion_200_ok(TestInfo test) throws HttpResponseException {
Ingestion ingestion = createEntity(create(test), adminAuthHeaders());
deleteEntity(ingestion.getId(), adminAuthHeaders());
}
@Test
public void delete_nonEmptyPipeline_4xx() {
void delete_nonEmptyPipeline_4xx() {
// TODO
}

View file

@ -146,7 +146,7 @@ public class PipelineResourceTest extends EntityResourceTest<Pipeline> {
}
@Test
public void post_validPipelines_as_admin_200_OK(TestInfo test) throws IOException {
void post_validPipelines_as_admin_200_OK(TestInfo test) throws IOException {
// Create team with different optional fields
CreatePipeline create = create(test);
createAndCheckEntity(create, adminAuthHeaders());
@ -156,22 +156,22 @@ public class PipelineResourceTest extends EntityResourceTest<Pipeline> {
}
@Test
public void post_PipelineWithUserOwner_200_ok(TestInfo test) throws IOException {
void post_PipelineWithUserOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(USER_OWNER1), adminAuthHeaders());
}
@Test
public void post_PipelineWithTeamOwner_200_ok(TestInfo test) throws IOException {
void post_PipelineWithTeamOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(TEAM_OWNER1).withDisplayName("Pipeline1"), adminAuthHeaders());
}
@Test
public void post_PipelineWithTasks_200_ok(TestInfo test) throws IOException {
void post_PipelineWithTasks_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withTasks(TASKS), adminAuthHeaders());
}
@Test
public void post_Pipeline_as_non_admin_401(TestInfo test) {
void post_Pipeline_as_non_admin_401(TestInfo test) {
CreatePipeline create = create(test);
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> createPipeline(create, authHeaders("test@open-metadata.org")));
@ -179,7 +179,7 @@ public class PipelineResourceTest extends EntityResourceTest<Pipeline> {
}
@Test
public void post_PipelineWithoutRequiredService_4xx(TestInfo test) {
void post_PipelineWithoutRequiredService_4xx(TestInfo test) {
CreatePipeline create = create(test).withService(null);
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> createPipeline(create, adminAuthHeaders()));
@ -187,7 +187,7 @@ public class PipelineResourceTest extends EntityResourceTest<Pipeline> {
}
@Test
public void post_PipelineWithDifferentService_200_ok(TestInfo test) throws IOException {
void post_PipelineWithDifferentService_200_ok(TestInfo test) throws IOException {
EntityReference[] differentServices = {AIRFLOW_REFERENCE, PREFECT_REFERENCE};
// Create Pipeline for each service and test APIs
@ -209,7 +209,7 @@ public class PipelineResourceTest extends EntityResourceTest<Pipeline> {
}
@Test
public void put_PipelineUrlUpdate_200(TestInfo test) throws IOException, URISyntaxException {
void put_PipelineUrlUpdate_200(TestInfo test) throws IOException, URISyntaxException {
CreatePipeline request =
create(test)
.withService(new EntityReference().withId(AIRFLOW_REFERENCE.getId()).withType("pipelineService"))
@ -233,7 +233,7 @@ public class PipelineResourceTest extends EntityResourceTest<Pipeline> {
}
@Test
public void put_PipelineTasksUpdate_200(TestInfo test) throws IOException {
void put_PipelineTasksUpdate_200(TestInfo test) throws IOException {
CreatePipeline request = create(test).withService(AIRFLOW_REFERENCE).withDescription(null);
Pipeline pipeline = createAndCheckEntity(request, adminAuthHeaders());
@ -246,7 +246,7 @@ public class PipelineResourceTest extends EntityResourceTest<Pipeline> {
}
@Test
public void put_AddRemovePipelineTasksUpdate_200(TestInfo test) throws IOException, URISyntaxException {
void put_AddRemovePipelineTasksUpdate_200(TestInfo test) throws IOException, URISyntaxException {
CreatePipeline request =
create(test)
.withService(AIRFLOW_REFERENCE)
@ -287,13 +287,13 @@ public class PipelineResourceTest extends EntityResourceTest<Pipeline> {
}
@Test
public void delete_emptyPipeline_200_ok(TestInfo test) throws HttpResponseException {
void delete_emptyPipeline_200_ok(TestInfo test) throws HttpResponseException {
Pipeline pipeline = createPipeline(create(test), adminAuthHeaders());
deleteEntity(pipeline.getId(), adminAuthHeaders());
}
@Test
public void delete_nonEmptyPipeline_4xx() {
void delete_nonEmptyPipeline_4xx() {
// TODO
}

View file

@ -128,7 +128,7 @@ public class PolicyResourceTest extends EntityResourceTest<Policy> {
}
@Test
public void post_PolicyWithoutPolicyType_400_badRequest(TestInfo test) {
void post_PolicyWithoutPolicyType_400_badRequest(TestInfo test) {
CreatePolicy create = create(test).withPolicyType(null);
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> createPolicy(create, adminAuthHeaders()));
@ -136,7 +136,7 @@ public class PolicyResourceTest extends EntityResourceTest<Policy> {
}
@Test
public void post_validPolicies_as_admin_200_OK(TestInfo test) throws IOException {
void post_validPolicies_as_admin_200_OK(TestInfo test) throws IOException {
// Create valid policy
CreatePolicy create = create(test);
createAndCheckEntity(create, adminAuthHeaders());
@ -145,25 +145,25 @@ public class PolicyResourceTest extends EntityResourceTest<Policy> {
}
@Test
public void post_PolicyWithUserOwner_200_ok(TestInfo test) throws IOException {
void post_PolicyWithUserOwner_200_ok(TestInfo test) throws IOException {
CreatePolicy create = create(test).withOwner(USER_OWNER1);
createAndCheckEntity(create, adminAuthHeaders());
}
@Test
public void post_PolicyWithTeamOwner_200_ok(TestInfo test) throws IOException {
void post_PolicyWithTeamOwner_200_ok(TestInfo test) throws IOException {
CreatePolicy create = create(test).withOwner(TEAM_OWNER1);
createAndCheckEntity(create, adminAuthHeaders());
}
@Test
public void post_AccessControlPolicyWithValidRules_200_ok(TestInfo test) throws IOException {
void post_AccessControlPolicyWithValidRules_200_ok(TestInfo test) throws IOException {
CreatePolicy create = createAccessControlPolicyWithValidRules(test);
createAndCheckEntity(create, adminAuthHeaders());
}
@Test
public void post_AccessControlPolicyWithInvalidRules_400_error(TestInfo test) throws IOException {
void post_AccessControlPolicyWithInvalidRules_400_error(TestInfo test) throws IOException {
CreatePolicy create = createAccessControlPolicyWithInvalidRules(test);
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> createEntity(create, adminAuthHeaders()));
@ -175,7 +175,7 @@ public class PolicyResourceTest extends EntityResourceTest<Policy> {
}
@Test
public void post_Policy_as_non_admin_401(TestInfo test) {
void post_Policy_as_non_admin_401(TestInfo test) {
CreatePolicy create = create(test);
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> createPolicy(create, authHeaders("test@open-metadata.org")));
@ -183,7 +183,7 @@ public class PolicyResourceTest extends EntityResourceTest<Policy> {
}
@Test
public void get_PolicyListWithInvalidLimitOffset_4xx() {
void get_PolicyListWithInvalidLimitOffset_4xx() {
// Limit must be >= 1 and <= 1000,000
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> listPolicies(null, -1, null, null, adminAuthHeaders()));
@ -198,7 +198,7 @@ public class PolicyResourceTest extends EntityResourceTest<Policy> {
}
@Test
public void get_PolicyListWithInvalidPaginationCursors_4xx() {
void get_PolicyListWithInvalidPaginationCursors_4xx() {
// Passing both before and after cursors is invalid
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> listPolicies(null, 1, "", "", adminAuthHeaders()));
@ -206,7 +206,7 @@ public class PolicyResourceTest extends EntityResourceTest<Policy> {
}
@Test
public void get_PolicyListWithValidLimitOffset_4xx(TestInfo test) throws HttpResponseException {
void get_PolicyListWithValidLimitOffset_4xx(TestInfo test) throws HttpResponseException {
// Create a large number of Policies
int maxPolicies = 40;
for (int i = 0; i < maxPolicies; i++) {
@ -267,7 +267,7 @@ public class PolicyResourceTest extends EntityResourceTest<Policy> {
}
@Test
public void patch_PolicyAttributes_200_ok(TestInfo test) throws IOException {
void patch_PolicyAttributes_200_ok(TestInfo test) throws IOException {
Policy policy = createAndCheckEntity(create(test), adminAuthHeaders());
URI uri = null;
@ -308,13 +308,13 @@ public class PolicyResourceTest extends EntityResourceTest<Policy> {
}
@Test
public void delete_emptyPolicy_200_ok(TestInfo test) throws HttpResponseException {
void delete_emptyPolicy_200_ok(TestInfo test) throws HttpResponseException {
Policy policy = createPolicy(create(test), adminAuthHeaders());
deleteEntity(policy.getId(), adminAuthHeaders());
}
@Test
public void delete_nonEmptyPolicy_4xx() {
void delete_nonEmptyPolicy_4xx() {
// TODO
}

View file

@ -62,7 +62,7 @@ public class DashboardServiceResourceTest extends EntityResourceTest<DashboardSe
}
@Test
public void post_withoutRequiredFields_400_badRequest(TestInfo test) {
void post_withoutRequiredFields_400_badRequest(TestInfo test) {
// Create dashboard with mandatory serviceType field empty
HttpResponseException exception =
assertThrows(
@ -77,7 +77,7 @@ public class DashboardServiceResourceTest extends EntityResourceTest<DashboardSe
}
@Test
public void post_validService_as_admin_200_ok(TestInfo test) throws IOException, URISyntaxException {
void post_validService_as_admin_200_ok(TestInfo test) throws IOException, URISyntaxException {
// Create dashboard service with different optional fields
Map<String, String> authHeaders = adminAuthHeaders();
createAndCheckEntity(create(test, 1).withDescription(null), authHeaders);
@ -86,7 +86,7 @@ public class DashboardServiceResourceTest extends EntityResourceTest<DashboardSe
}
@Test
public void post_validService_as_non_admin_401(TestInfo test) {
void post_validService_as_non_admin_401(TestInfo test) {
// Create dashboard service with different optional fields
Map<String, String> authHeaders = authHeaders("test@open-metadata.org");
@ -98,7 +98,7 @@ public class DashboardServiceResourceTest extends EntityResourceTest<DashboardSe
}
@Test
public void post_invalidIngestionSchedule_4xx(TestInfo test) throws URISyntaxException {
void post_invalidIngestionSchedule_4xx(TestInfo test) throws URISyntaxException {
// No jdbc connection set
CreateDashboardService create = create(test);
Schedule schedule = create.getIngestionSchedule();
@ -133,7 +133,7 @@ public class DashboardServiceResourceTest extends EntityResourceTest<DashboardSe
}
@Test
public void post_validIngestionSchedules_as_admin_200(TestInfo test) throws IOException, URISyntaxException {
void post_validIngestionSchedules_as_admin_200(TestInfo test) throws IOException, URISyntaxException {
Schedule schedule = new Schedule().withStartDate(new Date());
schedule.withRepeatFrequency("PT60M"); // Repeat every 60M should be valid
createAndCheckEntity(create(test, 1).withIngestionSchedule(schedule), adminAuthHeaders());
@ -146,7 +146,7 @@ public class DashboardServiceResourceTest extends EntityResourceTest<DashboardSe
}
@Test
public void post_ingestionScheduleIsTooShort_4xx(TestInfo test) throws URISyntaxException {
void post_ingestionScheduleIsTooShort_4xx(TestInfo test) throws URISyntaxException {
// No jdbc connection set
CreateDashboardService create = create(test);
Schedule schedule = create.getIngestionSchedule();
@ -163,7 +163,7 @@ public class DashboardServiceResourceTest extends EntityResourceTest<DashboardSe
}
@Test
public void put_updateService_as_admin_2xx(TestInfo test) throws IOException, URISyntaxException {
void put_updateService_as_admin_2xx(TestInfo test) throws IOException, URISyntaxException {
DashboardService service =
createAndCheckEntity(create(test).withDescription(null).withIngestionSchedule(null), adminAuthHeaders());
@ -201,7 +201,7 @@ public class DashboardServiceResourceTest extends EntityResourceTest<DashboardSe
}
@Test
public void put_update_as_non_admin_401(TestInfo test) throws IOException, URISyntaxException {
void put_update_as_non_admin_401(TestInfo test) throws IOException, URISyntaxException {
Map<String, String> authHeaders = adminAuthHeaders();
createAndCheckEntity(create(test).withDescription(null).withIngestionSchedule(null), authHeaders);
@ -216,7 +216,7 @@ public class DashboardServiceResourceTest extends EntityResourceTest<DashboardSe
}
@Test
public void delete_ExistentDashboardService_as_admin_200(TestInfo test)
void delete_ExistentDashboardService_as_admin_200(TestInfo test)
throws HttpResponseException, URISyntaxException {
Map<String, String> authHeaders = adminAuthHeaders();
DashboardService dashboardService = createEntity(create(test), authHeaders);
@ -224,7 +224,7 @@ public class DashboardServiceResourceTest extends EntityResourceTest<DashboardSe
}
@Test
public void delete_as_user_401(TestInfo test) throws HttpResponseException, URISyntaxException {
void delete_as_user_401(TestInfo test) throws HttpResponseException, URISyntaxException {
Map<String, String> authHeaders = adminAuthHeaders();
DashboardService dashboardService = createEntity(create(test), authHeaders);
HttpResponseException exception =
@ -235,7 +235,7 @@ public class DashboardServiceResourceTest extends EntityResourceTest<DashboardSe
}
@Test
public void delete_notExistentDashboardService() {
void delete_notExistentDashboardService() {
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> getEntity(TestUtils.NON_EXISTENT_ENTITY, adminAuthHeaders()));
TestUtils.assertResponse(

View file

@ -60,7 +60,7 @@ public class DatabaseServiceResourceTest extends EntityResourceTest<DatabaseServ
}
@Test
public void post_validDatabaseService_as_admin_200_ok(TestInfo test) throws IOException {
void post_validDatabaseService_as_admin_200_ok(TestInfo test) throws IOException {
// Create database service with different optional fields
Map<String, String> authHeaders = adminAuthHeaders();
createAndCheckEntity(create(test, 1).withDescription(null), authHeaders);
@ -69,7 +69,7 @@ public class DatabaseServiceResourceTest extends EntityResourceTest<DatabaseServ
}
@Test
public void post_validDatabaseService_as_non_admin_401(TestInfo test) {
void post_validDatabaseService_as_non_admin_401(TestInfo test) {
// Create database service with different optional fields
Map<String, String> authHeaders = authHeaders("test@open-metadata.org");
@ -81,7 +81,7 @@ public class DatabaseServiceResourceTest extends EntityResourceTest<DatabaseServ
}
@Test
public void post_invalidDatabaseServiceNoJdbc_4xx(TestInfo test) {
void post_invalidDatabaseServiceNoJdbc_4xx(TestInfo test) {
// No jdbc connection set
CreateDatabaseService create = create(test).withJdbc(null);
HttpResponseException exception =
@ -90,7 +90,7 @@ public class DatabaseServiceResourceTest extends EntityResourceTest<DatabaseServ
}
@Test
public void post_invalidIngestionSchedule_4xx(TestInfo test) {
void post_invalidIngestionSchedule_4xx(TestInfo test) {
// No jdbc connection set
CreateDatabaseService create = create(test);
Schedule schedule = create.getIngestionSchedule();
@ -125,7 +125,7 @@ public class DatabaseServiceResourceTest extends EntityResourceTest<DatabaseServ
}
@Test
public void post_validIngestionSchedules_as_admin_200(TestInfo test) throws IOException {
void post_validIngestionSchedules_as_admin_200(TestInfo test) throws IOException {
Schedule schedule = new Schedule().withStartDate(new Date());
schedule.withRepeatFrequency("PT60M"); // Repeat every 60M should be valid
createAndCheckEntity(create(test, 1).withIngestionSchedule(schedule), adminAuthHeaders());
@ -138,7 +138,7 @@ public class DatabaseServiceResourceTest extends EntityResourceTest<DatabaseServ
}
@Test
public void post_ingestionScheduleIsTooShort_4xx(TestInfo test) {
void post_ingestionScheduleIsTooShort_4xx(TestInfo test) {
// No jdbc connection set
CreateDatabaseService create = create(test);
Schedule schedule = create.getIngestionSchedule();
@ -155,7 +155,7 @@ public class DatabaseServiceResourceTest extends EntityResourceTest<DatabaseServ
}
@Test
public void put_updateDatabaseService_as_admin_2xx(TestInfo test) throws IOException {
void put_updateDatabaseService_as_admin_2xx(TestInfo test) throws IOException {
DatabaseService service =
createAndCheckEntity(create(test).withDescription(null).withIngestionSchedule(null), adminAuthHeaders());
@ -178,7 +178,7 @@ public class DatabaseServiceResourceTest extends EntityResourceTest<DatabaseServ
}
@Test
public void put_update_as_non_admin_401(TestInfo test) throws IOException {
void put_update_as_non_admin_401(TestInfo test) throws IOException {
Map<String, String> authHeaders = adminAuthHeaders();
createAndCheckEntity(create(test).withDescription(null).withIngestionSchedule(null), authHeaders);
@ -193,14 +193,14 @@ public class DatabaseServiceResourceTest extends EntityResourceTest<DatabaseServ
}
@Test
public void delete_ExistentDatabaseService_as_admin_200(TestInfo test) throws HttpResponseException {
void delete_ExistentDatabaseService_as_admin_200(TestInfo test) throws HttpResponseException {
Map<String, String> authHeaders = adminAuthHeaders();
DatabaseService databaseService = createEntity(create(test), authHeaders);
deleteEntity(databaseService.getId(), authHeaders);
}
@Test
public void delete_as_user_401(TestInfo test) throws HttpResponseException {
void delete_as_user_401(TestInfo test) throws HttpResponseException {
Map<String, String> authHeaders = adminAuthHeaders();
DatabaseService databaseService = createEntity(create(test), authHeaders);
HttpResponseException exception =

View file

@ -75,7 +75,7 @@ public class MessagingServiceResourceTest extends EntityResourceTest<MessagingSe
}
@Test
public void post_withoutRequiredFields_400_badRequest(TestInfo test) {
void post_withoutRequiredFields_400_badRequest(TestInfo test) {
// Create messaging with mandatory serviceType field empty
HttpResponseException exception =
assertThrows(
@ -90,7 +90,7 @@ public class MessagingServiceResourceTest extends EntityResourceTest<MessagingSe
}
@Test
public void post_validService_as_admin_200_ok(TestInfo test) throws IOException {
void post_validService_as_admin_200_ok(TestInfo test) throws IOException {
// Create messaging service with different optional fields
Map<String, String> authHeaders = adminAuthHeaders();
createAndCheckEntity(create(test, 1).withDescription(null), authHeaders);
@ -99,7 +99,7 @@ public class MessagingServiceResourceTest extends EntityResourceTest<MessagingSe
}
@Test
public void post_validService_as_non_admin_401(TestInfo test) {
void post_validService_as_non_admin_401(TestInfo test) {
// Create messaging service with different optional fields
Map<String, String> authHeaders = authHeaders("test@open-metadata.org");
@ -111,7 +111,7 @@ public class MessagingServiceResourceTest extends EntityResourceTest<MessagingSe
}
@Test
public void post_invalidIngestionSchedule_4xx(TestInfo test) {
void post_invalidIngestionSchedule_4xx(TestInfo test) {
// No jdbc connection set
CreateMessagingService create = create(test);
Schedule schedule = create.getIngestionSchedule();
@ -146,7 +146,7 @@ public class MessagingServiceResourceTest extends EntityResourceTest<MessagingSe
}
@Test
public void post_validIngestionSchedules_as_admin_200(TestInfo test) throws IOException {
void post_validIngestionSchedules_as_admin_200(TestInfo test) throws IOException {
Schedule schedule = new Schedule().withStartDate(new Date());
schedule.withRepeatFrequency("PT60M"); // Repeat every 60M should be valid
createAndCheckEntity(create(test, 1).withIngestionSchedule(schedule), adminAuthHeaders());
@ -159,7 +159,7 @@ public class MessagingServiceResourceTest extends EntityResourceTest<MessagingSe
}
@Test
public void post_ingestionScheduleIsTooShort_4xx(TestInfo test) {
void post_ingestionScheduleIsTooShort_4xx(TestInfo test) {
// No jdbc connection set
CreateMessagingService create = create(test);
Schedule schedule = create.getIngestionSchedule();
@ -176,7 +176,7 @@ public class MessagingServiceResourceTest extends EntityResourceTest<MessagingSe
}
@Test
public void put_updateService_as_admin_2xx(TestInfo test) throws IOException, URISyntaxException {
void put_updateService_as_admin_2xx(TestInfo test) throws IOException, URISyntaxException {
MessagingService service =
createAndCheckEntity(
create(test)
@ -228,7 +228,7 @@ public class MessagingServiceResourceTest extends EntityResourceTest<MessagingSe
}
@Test
public void put_update_as_non_admin_401(TestInfo test) throws IOException {
void put_update_as_non_admin_401(TestInfo test) throws IOException {
Map<String, String> authHeaders = adminAuthHeaders();
createAndCheckEntity(create(test).withDescription(null).withIngestionSchedule(null), authHeaders);
@ -243,14 +243,14 @@ public class MessagingServiceResourceTest extends EntityResourceTest<MessagingSe
}
@Test
public void delete_ExistentMessagingService_as_admin_200(TestInfo test) throws HttpResponseException {
void delete_ExistentMessagingService_as_admin_200(TestInfo test) throws HttpResponseException {
Map<String, String> authHeaders = adminAuthHeaders();
MessagingService messagingService = createEntity(create(test), authHeaders);
deleteEntity(messagingService.getId(), authHeaders);
}
@Test
public void delete_as_user_401(TestInfo test) throws HttpResponseException {
void delete_as_user_401(TestInfo test) throws HttpResponseException {
Map<String, String> authHeaders = adminAuthHeaders();
MessagingService messagingService = createEntity(create(test), authHeaders);
HttpResponseException exception =
@ -261,7 +261,7 @@ public class MessagingServiceResourceTest extends EntityResourceTest<MessagingSe
}
@Test
public void delete_notExistentMessagingService() {
void delete_notExistentMessagingService() {
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> getEntity(TestUtils.NON_EXISTENT_ENTITY, adminAuthHeaders()));
TestUtils.assertResponse(

View file

@ -73,7 +73,7 @@ public class PipelineServiceResourceTest extends EntityResourceTest<PipelineServ
}
@Test
public void post_withoutRequiredFields_400_badRequest(TestInfo test) {
void post_withoutRequiredFields_400_badRequest(TestInfo test) {
// Create pipeline with mandatory serviceType field empty
HttpResponseException exception =
assertThrows(
@ -88,7 +88,7 @@ public class PipelineServiceResourceTest extends EntityResourceTest<PipelineServ
}
@Test
public void post_validService_as_admin_200_ok(TestInfo test) throws IOException {
void post_validService_as_admin_200_ok(TestInfo test) throws IOException {
// Create pipeline service with different optional fields
Map<String, String> authHeaders = adminAuthHeaders();
createAndCheckEntity(create(test, 1).withDescription(null), authHeaders);
@ -97,7 +97,7 @@ public class PipelineServiceResourceTest extends EntityResourceTest<PipelineServ
}
@Test
public void post_validService_as_non_admin_401(TestInfo test) {
void post_validService_as_non_admin_401(TestInfo test) {
// Create pipeline service with different optional fields
Map<String, String> authHeaders = authHeaders("test@open-metadata.org");
@ -109,7 +109,7 @@ public class PipelineServiceResourceTest extends EntityResourceTest<PipelineServ
}
@Test
public void post_invalidIngestionSchedule_4xx(TestInfo test) {
void post_invalidIngestionSchedule_4xx(TestInfo test) {
// No jdbc connection set
CreatePipelineService create = create(test);
Schedule schedule = create.getIngestionSchedule();
@ -144,7 +144,7 @@ public class PipelineServiceResourceTest extends EntityResourceTest<PipelineServ
}
@Test
public void post_validIngestionSchedules_as_admin_200(TestInfo test) throws IOException {
void post_validIngestionSchedules_as_admin_200(TestInfo test) throws IOException {
Schedule schedule = new Schedule().withStartDate(new Date());
schedule.withRepeatFrequency("PT60M"); // Repeat every 60M should be valid
createAndCheckEntity(create(test, 1).withIngestionSchedule(schedule), adminAuthHeaders());
@ -157,7 +157,7 @@ public class PipelineServiceResourceTest extends EntityResourceTest<PipelineServ
}
@Test
public void post_ingestionScheduleIsTooShort_4xx(TestInfo test) {
void post_ingestionScheduleIsTooShort_4xx(TestInfo test) {
// No jdbc connection set
CreatePipelineService create = create(test);
Schedule schedule = create.getIngestionSchedule();
@ -174,7 +174,7 @@ public class PipelineServiceResourceTest extends EntityResourceTest<PipelineServ
}
@Test
public void put_updateService_as_admin_2xx(TestInfo test) throws IOException, URISyntaxException {
void put_updateService_as_admin_2xx(TestInfo test) throws IOException, URISyntaxException {
PipelineService service =
createAndCheckEntity(
create(test).withDescription(null).withIngestionSchedule(null).withPipelineUrl(PIPELINE_SERVICE_URL),
@ -208,7 +208,7 @@ public class PipelineServiceResourceTest extends EntityResourceTest<PipelineServ
}
@Test
public void put_update_as_non_admin_401(TestInfo test) throws IOException {
void put_update_as_non_admin_401(TestInfo test) throws IOException {
Map<String, String> authHeaders = adminAuthHeaders();
createAndCheckEntity(create(test).withDescription(null).withIngestionSchedule(null), authHeaders);
@ -223,14 +223,14 @@ public class PipelineServiceResourceTest extends EntityResourceTest<PipelineServ
}
@Test
public void delete_ExistentPipelineService_as_admin_200(TestInfo test) throws HttpResponseException {
void delete_ExistentPipelineService_as_admin_200(TestInfo test) throws HttpResponseException {
Map<String, String> authHeaders = adminAuthHeaders();
PipelineService pipelineService = createEntity(create(test), authHeaders);
deleteEntity(pipelineService.getId(), authHeaders);
}
@Test
public void delete_as_user_401(TestInfo test) throws HttpResponseException {
void delete_as_user_401(TestInfo test) throws HttpResponseException {
Map<String, String> authHeaders = adminAuthHeaders();
PipelineService pipelineService = createEntity(create(test), authHeaders);
HttpResponseException exception =
@ -241,7 +241,7 @@ public class PipelineServiceResourceTest extends EntityResourceTest<PipelineServ
}
@Test
public void delete_notExistentPipelineService() {
void delete_notExistentPipelineService() {
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> getEntity(TestUtils.NON_EXISTENT_ENTITY, adminAuthHeaders()));
TestUtils.assertResponse(

View file

@ -56,7 +56,7 @@ public class StorageServiceResourceTest extends EntityResourceTest<StorageServic
}
@Test
public void post_validService_as_admin_200_ok(TestInfo test) throws IOException {
void post_validService_as_admin_200_ok(TestInfo test) throws IOException {
// Create storage service with different optional fields
Map<String, String> authHeaders = adminAuthHeaders();
createAndCheckEntity(create(test, 1).withDescription(null), authHeaders);
@ -64,7 +64,7 @@ public class StorageServiceResourceTest extends EntityResourceTest<StorageServic
}
@Test
public void post_validService_as_non_admin_401(TestInfo test) {
void post_validService_as_non_admin_401(TestInfo test) {
// Create storage service with different optional fields
Map<String, String> authHeaders = authHeaders("test@open-metadata.org");
@ -76,14 +76,14 @@ public class StorageServiceResourceTest extends EntityResourceTest<StorageServic
}
@Test
public void put_updateStorageService_as_admin_2xx(TestInfo test) throws IOException {
void put_updateStorageService_as_admin_2xx(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withDescription(null), adminAuthHeaders());
// TODO add more tests for different fields
}
@Test
public void put_update_as_non_admin_401(TestInfo test) throws IOException {
void put_update_as_non_admin_401(TestInfo test) throws IOException {
Map<String, String> authHeaders = adminAuthHeaders();
createAndCheckEntity(create(test).withDescription(null), authHeaders);
@ -98,14 +98,14 @@ public class StorageServiceResourceTest extends EntityResourceTest<StorageServic
}
@Test
public void delete_ExistentService_as_admin_200(TestInfo test) throws HttpResponseException {
void delete_ExistentService_as_admin_200(TestInfo test) throws HttpResponseException {
Map<String, String> authHeaders = adminAuthHeaders();
StorageService storageService = createEntity(create(test), authHeaders);
deleteEntity(storageService.getId(), authHeaders);
}
@Test
public void delete_as_user_401(TestInfo test) throws HttpResponseException {
void delete_as_user_401(TestInfo test) throws HttpResponseException {
Map<String, String> authHeaders = adminAuthHeaders();
StorageService storageService = createEntity(create(test), authHeaders);
HttpResponseException exception =
@ -116,7 +116,7 @@ public class StorageServiceResourceTest extends EntityResourceTest<StorageServic
}
@Test
public void delete_notExistentStorageService() {
void delete_notExistentStorageService() {
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> getEntity(TestUtils.NON_EXISTENT_ENTITY, adminAuthHeaders()));
TestUtils.assertResponse(

View file

@ -61,7 +61,7 @@ public class TagResourceTest extends CatalogApplicationTest {
@Test
@Order(0)
public void list_categories_200() throws IOException {
void list_categories_200() throws IOException {
// GET .../tags to list all tag categories
CategoryList list = listCategories();
@ -77,7 +77,7 @@ public class TagResourceTest extends CatalogApplicationTest {
}
@Test
public void get_category_200() throws HttpResponseException {
void get_category_200() throws HttpResponseException {
// GET .../tags/{category} to get a category
TagCategory category = getCategory("User", authHeaders("test@open-metadata.org"));
assertEquals("User", category.getName());
@ -85,7 +85,7 @@ public class TagResourceTest extends CatalogApplicationTest {
}
@Test
public void get_nonExistentCategory_404() {
void get_nonExistentCategory_404() {
// GET .../tags/{nonExistentCategory} returns 404
String nonExistent = "nonExistent";
HttpResponseException exception =
@ -94,7 +94,7 @@ public class TagResourceTest extends CatalogApplicationTest {
}
@Test
public void get_validTag_200() throws HttpResponseException {
void get_validTag_200() throws HttpResponseException {
// GET .../tags/{category}/{tag} returns requested tag
Tag tag = getTag("User.Address", adminAuthHeaders());
String parentURI = BASE_URL + "/User";
@ -102,7 +102,7 @@ public class TagResourceTest extends CatalogApplicationTest {
}
@Test
public void get_nonExistentTag_404() {
void get_nonExistentTag_404() {
// GET .../tags/{category}/{nonExistent} returns 404 Not found
String tagFQN = "User.NonExistent";
HttpResponseException exception =
@ -111,7 +111,7 @@ public class TagResourceTest extends CatalogApplicationTest {
}
@Test
public void post_alreadyExistingTagCategory_4xx() {
void post_alreadyExistingTagCategory_4xx() {
// POST .../tags/{allReadyExistingCategory} returns 4xx
CreateTagCategory create =
new CreateTagCategory()
@ -124,7 +124,7 @@ public class TagResourceTest extends CatalogApplicationTest {
}
@Test
public void post_validTagCategory_as_admin_201(TestInfo test) throws HttpResponseException {
void post_validTagCategory_as_admin_201(TestInfo test) throws HttpResponseException {
// POST .../tags/{newCategory} returns 201
String categoryName = test.getDisplayName().substring(0, 10); // Form a unique category name based on the test name
CreateTagCategory create =
@ -137,7 +137,7 @@ public class TagResourceTest extends CatalogApplicationTest {
}
@Test
public void post_InvalidTagCategory_4xx(TestInfo test) {
void post_InvalidTagCategory_4xx(TestInfo test) {
// POST .../tags/{newCategory} returns 201
String categoryName = test.getDisplayName().substring(0, 10); // Form a unique category name based on the test name
@ -164,7 +164,7 @@ public class TagResourceTest extends CatalogApplicationTest {
@Order(1)
@Test
public void post_validTags_200() throws HttpResponseException, JsonProcessingException {
void post_validTags_200() throws HttpResponseException, JsonProcessingException {
// POST .../tags/{category}/{primaryTag} to create primary tag
TagCategory category = getCategory("User", authHeaders("test@open-meatadata.org"));
CreateTag create = new CreateTag().withName("PrimaryTag").withDescription("description");
@ -180,7 +180,7 @@ public class TagResourceTest extends CatalogApplicationTest {
}
@Test
public void post_invalidTags_400() {
void post_invalidTags_400() {
// Missing description in POST primary tag
CreateTag create = new CreateTag().withName("noDescription").withDescription(null);
HttpResponseException exception =
@ -206,7 +206,7 @@ public class TagResourceTest extends CatalogApplicationTest {
}
@Test
public void post_newTagsOnNonExistentParents_404() {
void post_newTagsOnNonExistentParents_404() {
// POST .../tags/{nonExistent}/{primaryTag} where category does not exist
String nonExistent = "nonExistent";
CreateTag create = new CreateTag().withName("primary").withDescription("description");
@ -222,7 +222,7 @@ public class TagResourceTest extends CatalogApplicationTest {
}
@Test
public void put_tagCategory_200(TestInfo test) throws HttpResponseException {
void put_tagCategory_200(TestInfo test) throws HttpResponseException {
// PUT .../tags/{user} update the user tags
String newCategoryName = test.getDisplayName().substring(0, 10);
CreateTagCategory create =
@ -238,7 +238,7 @@ public class TagResourceTest extends CatalogApplicationTest {
}
@Test
public void put_tagCategoryInvalidRequest_400(TestInfo test) {
void put_tagCategoryInvalidRequest_400(TestInfo test) {
// Primary tag with missing description
String newCategoryName = test.getDisplayName().substring(0, 10);
CreateTagCategory create =
@ -257,7 +257,7 @@ public class TagResourceTest extends CatalogApplicationTest {
}
@Test
public void put_primaryTag_200() throws HttpResponseException, JsonProcessingException {
void put_primaryTag_200() throws HttpResponseException, JsonProcessingException {
// PUT .../tags/{user}/{address} update the tag
CreateTag create = new CreateTag().withName("AddressUpdated").withDescription("updatedDescription");
updatePrimaryTag("User", "Address", create, adminAuthHeaders());
@ -268,7 +268,7 @@ public class TagResourceTest extends CatalogApplicationTest {
}
@Test
public void put_secondaryTag_200() throws HttpResponseException, JsonProcessingException {
void put_secondaryTag_200() throws HttpResponseException, JsonProcessingException {
// PUT .../tags/{user}/{primaryTag}/{secondaryTag} update the tag
CreateTag create = new CreateTag().withName("SecondaryTag1").withDescription("description");
updateSecondaryTag("User", "PrimaryTag", "SecondaryTag", create, adminAuthHeaders());
@ -279,7 +279,7 @@ public class TagResourceTest extends CatalogApplicationTest {
}
@Test
public void put_tagInvalidRequest_404() {
void put_tagInvalidRequest_404() {
// Primary tag with missing description
CreateTag create = new CreateTag().withName("AddressUpdated").withDescription(null);
HttpResponseException exception =

View file

@ -53,7 +53,7 @@ public class RoleResourceTest extends EntityResourceTest<Role> {
}
@Test
public void post_validRoles_as_admin_200_OK(TestInfo test) throws IOException {
void post_validRoles_as_admin_200_OK(TestInfo test) throws IOException {
// Create role with different optional fields
CreateRole create = create(test, 1);
createAndCheckEntity(create, adminAuthHeaders());
@ -69,7 +69,7 @@ public class RoleResourceTest extends EntityResourceTest<Role> {
}
@Test
public void post_validRoles_as_non_admin_401(TestInfo test) {
void post_validRoles_as_non_admin_401(TestInfo test) {
// Create role with different optional fields
Map<String, String> authHeaders = authHeaders("test@open-metadata.org");
CreateRole create = create(test, 1);
@ -82,14 +82,14 @@ public class RoleResourceTest extends EntityResourceTest<Role> {
* @see EntityResourceTest#put_addDeleteFollower_200 for tests related getting role with entities owned by the role
*/
@Test
public void delete_validRole_200_OK(TestInfo test) throws IOException {
void delete_validRole_200_OK(TestInfo test) throws IOException {
CreateRole create = create(test);
Role role = createAndCheckEntity(create, adminAuthHeaders());
deleteEntity(role.getId(), adminAuthHeaders());
}
@Test
public void delete_validRole_as_non_admin_401(TestInfo test) throws IOException {
void delete_validRole_as_non_admin_401(TestInfo test) throws IOException {
CreateRole create = create(test);
Role role = createAndCheckEntity(create, adminAuthHeaders());
HttpResponseException exception =
@ -99,7 +99,7 @@ public class RoleResourceTest extends EntityResourceTest<Role> {
}
@Test
public void patch_roleDeletedDisallowed_400(TestInfo test) throws HttpResponseException, JsonProcessingException {
void patch_roleDeletedDisallowed_400(TestInfo test) throws HttpResponseException, JsonProcessingException {
// Ensure role deleted attribute can't be changed using patch
Role role = createRole(create(test), adminAuthHeaders());
String roleJson = JsonUtils.pojoToJson(role);
@ -110,7 +110,7 @@ public class RoleResourceTest extends EntityResourceTest<Role> {
}
@Test
public void patch_roleAttributes_as_non_admin_403(TestInfo test)
void patch_roleAttributes_as_non_admin_403(TestInfo test)
throws HttpResponseException, JsonProcessingException {
// Create table without any attributes
Role role = createRole(create(test), adminAuthHeaders());

View file

@ -68,7 +68,7 @@ public class TeamResourceTest extends EntityResourceTest<Team> {
}
@Test
public void post_validTeams_as_admin_200_OK(TestInfo test) throws IOException {
void post_validTeams_as_admin_200_OK(TestInfo test) throws IOException {
// Create team with different optional fields
CreateTeam create = create(test, 1);
createAndCheckEntity(create, adminAuthHeaders());
@ -87,7 +87,7 @@ public class TeamResourceTest extends EntityResourceTest<Team> {
}
@Test
public void post_validTeams_as_non_admin_401(TestInfo test) {
void post_validTeams_as_non_admin_401(TestInfo test) {
// Create team with different optional fields
Map<String, String> authHeaders = authHeaders("test@open-metadata.org");
CreateTeam create = create(test, 1);
@ -97,7 +97,7 @@ public class TeamResourceTest extends EntityResourceTest<Team> {
}
@Test
public void post_teamWithUsers_200_OK(TestInfo test) throws IOException {
void post_teamWithUsers_200_OK(TestInfo test) throws IOException {
// Add team to user relationships while creating a team
UserResourceTest userResourceTest = new UserResourceTest();
User user1 = createUser(userResourceTest.create(test, 1), authHeaders("test@open-metadata.org"));
@ -119,7 +119,7 @@ public class TeamResourceTest extends EntityResourceTest<Team> {
}
@Test
public void get_teamWithInvalidFields_400_BadRequest(TestInfo test) throws HttpResponseException {
void get_teamWithInvalidFields_400_BadRequest(TestInfo test) throws HttpResponseException {
CreateTeam create = create(test);
Team team = createTeam(create, adminAuthHeaders());
@ -138,7 +138,7 @@ public class TeamResourceTest extends EntityResourceTest<Team> {
* @see EntityResourceTest#put_addDeleteFollower_200 for tests related getting team with entities owned by the team
*/
@Test
public void delete_validTeam_200_OK(TestInfo test) throws IOException {
void delete_validTeam_200_OK(TestInfo test) throws IOException {
UserResourceTest userResourceTest = new UserResourceTest();
User user1 = createUser(userResourceTest.create(test, 1), adminAuthHeaders());
List<UUID> users = Collections.singletonList(user1.getId());
@ -154,7 +154,7 @@ public class TeamResourceTest extends EntityResourceTest<Team> {
}
@Test
public void delete_validTeam_as_non_admin_401(TestInfo test) throws IOException {
void delete_validTeam_as_non_admin_401(TestInfo test) throws IOException {
UserResourceTest userResourceTest = new UserResourceTest();
User user1 = createUser(userResourceTest.create(test, 1), authHeaders("test@open-metadata.org"));
List<UUID> users = Collections.singletonList(user1.getId());
@ -167,7 +167,7 @@ public class TeamResourceTest extends EntityResourceTest<Team> {
}
@Test
public void patch_teamDeletedDisallowed_400(TestInfo test) throws HttpResponseException, JsonProcessingException {
void patch_teamDeletedDisallowed_400(TestInfo test) throws HttpResponseException, JsonProcessingException {
// Ensure team deleted attribute can't be changed using patch
Team team = createTeam(create(test), adminAuthHeaders());
String teamJson = JsonUtils.pojoToJson(team);
@ -229,7 +229,7 @@ public class TeamResourceTest extends EntityResourceTest<Team> {
// }
@Test
public void patch_teamAttributes_as_non_admin_403(TestInfo test)
void patch_teamAttributes_as_non_admin_403(TestInfo test)
throws HttpResponseException, JsonProcessingException {
// Create table without any attributes
Team team = createTeam(create(test), adminAuthHeaders());

View file

@ -86,7 +86,7 @@ public class UserResourceTest extends EntityResourceTest<User> {
}
@Test
public void post_userWithoutEmail_400_badRequest(TestInfo test) {
void post_userWithoutEmail_400_badRequest(TestInfo test) {
// Create user with mandatory email field null
CreateUser create = create(test).withEmail(null);
HttpResponseException exception =
@ -115,7 +115,7 @@ public class UserResourceTest extends EntityResourceTest<User> {
}
@Test
public void post_validUser_200_ok(TestInfo test) throws IOException {
void post_validUser_200_ok(TestInfo test) throws IOException {
// Create user with different optional fields
CreateUser create = create(test, 1);
createAndCheckEntity(create, adminAuthHeaders());
@ -134,7 +134,7 @@ public class UserResourceTest extends EntityResourceTest<User> {
}
@Test
public void put_validUser_200_ok(TestInfo test) throws IOException {
void put_validUser_200_ok(TestInfo test) throws IOException {
// Create user with different optional fields
CreateUser create = create(test, 1);
User user = updateAndCheckEntity(create, CREATED, adminAuthHeaders(), UpdateType.CREATED, null);
@ -155,7 +155,7 @@ public class UserResourceTest extends EntityResourceTest<User> {
}
@Test
public void post_validAdminUser_Non_Admin_401(TestInfo test) {
void post_validAdminUser_Non_Admin_401(TestInfo test) {
CreateUser create =
create(test, 6).withName("test").withDisplayName("displayName").withEmail("test@email.com").withIsAdmin(true);
@ -166,14 +166,14 @@ public class UserResourceTest extends EntityResourceTest<User> {
}
@Test
public void post_validAdminUser_200_ok(TestInfo test) throws IOException {
void post_validAdminUser_200_ok(TestInfo test) throws IOException {
CreateUser create =
create(test, 6).withName("test1").withDisplayName("displayName").withEmail("test1@email.com").withIsAdmin(true);
createAndCheckEntity(create, adminAuthHeaders());
}
@Test
public void post_validUserWithTeams_200_ok(TestInfo test) throws IOException {
void post_validUserWithTeams_200_ok(TestInfo test) throws IOException {
// Create user with different optional fields
TeamResourceTest teamResourceTest = new TeamResourceTest();
Team team1 = createTeam(teamResourceTest.create(test, 1), adminAuthHeaders());
@ -190,7 +190,7 @@ public class UserResourceTest extends EntityResourceTest<User> {
}
@Test
public void post_validUserWithRoles_200_ok(TestInfo test) throws IOException {
void post_validUserWithRoles_200_ok(TestInfo test) throws IOException {
// Create user with different optional fields
RoleResourceTest roleResourceTest = new RoleResourceTest();
Role role1 = createRole(roleResourceTest.create(test, 1), adminAuthHeaders());
@ -207,7 +207,7 @@ public class UserResourceTest extends EntityResourceTest<User> {
}
@Test
public void get_listUsersWithTeams_200_ok(TestInfo test) throws IOException {
void get_listUsersWithTeams_200_ok(TestInfo test) throws IOException {
TeamResourceTest teamResourceTest = new TeamResourceTest();
Team team1 = createTeam(teamResourceTest.create(test, 1), adminAuthHeaders());
Team team2 = createTeam(teamResourceTest.create(test, 2), adminAuthHeaders());
@ -256,7 +256,7 @@ public class UserResourceTest extends EntityResourceTest<User> {
}
@Test
public void get_userWithInvalidFields_400_BadRequest(TestInfo test) throws HttpResponseException {
void get_userWithInvalidFields_400_BadRequest(TestInfo test) throws HttpResponseException {
User user = createUser(create(test), adminAuthHeaders());
// Empty query field .../users?fields=
@ -276,7 +276,7 @@ public class UserResourceTest extends EntityResourceTest<User> {
* @see TableResourceTest also tests GET user returns owns list
*/
@Test
public void patch_userNameChange_as_another_user_401(TestInfo test)
void patch_userNameChange_as_another_user_401(TestInfo test)
throws HttpResponseException, JsonProcessingException {
// Ensure username can't be changed using patch
User user =
@ -291,7 +291,7 @@ public class UserResourceTest extends EntityResourceTest<User> {
}
@Test
public void patch_makeAdmin_as_another_user_401(TestInfo test) throws HttpResponseException, JsonProcessingException {
void patch_makeAdmin_as_another_user_401(TestInfo test) throws HttpResponseException, JsonProcessingException {
// Ensure username can't be changed using patch
User user =
createUser(
@ -305,7 +305,7 @@ public class UserResourceTest extends EntityResourceTest<User> {
}
@Test
public void patch_userNameChange_as_same_user_200_ok(TestInfo test)
void patch_userNameChange_as_same_user_200_ok(TestInfo test)
throws HttpResponseException, JsonProcessingException {
// Ensure username can't be changed using patch
User user =
@ -320,7 +320,7 @@ public class UserResourceTest extends EntityResourceTest<User> {
}
@Test
public void patch_userDeletedDisallowed_400(TestInfo test) throws HttpResponseException, JsonProcessingException {
void patch_userDeletedDisallowed_400(TestInfo test) throws HttpResponseException, JsonProcessingException {
// Ensure user deleted attributed can't be changed using patch
User user = createUser(create(test), adminAuthHeaders());
String userJson = JsonUtils.pojoToJson(user);
@ -331,7 +331,7 @@ public class UserResourceTest extends EntityResourceTest<User> {
}
@Test
public void patch_userAttributes_as_admin_200_ok(TestInfo test) throws IOException {
void patch_userAttributes_as_admin_200_ok(TestInfo test) throws IOException {
// Create user without any attributes - ***Note*** isAdmin by default is false.
User user = createUser(create(test), adminAuthHeaders());
assertListNull(user.getDisplayName(), user.getIsBot(), user.getProfile(), user.getTimezone());
@ -444,7 +444,7 @@ public class UserResourceTest extends EntityResourceTest<User> {
}
@Test
public void delete_validUser_as_non_admin_401(TestInfo test) throws HttpResponseException {
void delete_validUser_as_non_admin_401(TestInfo test) throws HttpResponseException {
CreateUser create = create(test).withName("test3").withEmail("test3@email.com");
User user = createUser(create, authHeaders("test3"));
@ -454,7 +454,7 @@ public class UserResourceTest extends EntityResourceTest<User> {
}
@Test
public void delete_validUser_as_admin_200(TestInfo test) throws IOException {
void delete_validUser_as_admin_200(TestInfo test) throws IOException {
TeamResourceTest teamResourceTest = new TeamResourceTest();
Team team = createTeam(teamResourceTest.create(test), adminAuthHeaders());
List<UUID> teamIds = Collections.singletonList(team.getId());

View file

@ -57,7 +57,7 @@ public class TopicResourceTest extends EntityResourceTest<Topic> {
}
@Test
public void post_validTopics_as_admin_200_OK(TestInfo test) throws IOException {
void post_validTopics_as_admin_200_OK(TestInfo test) throws IOException {
// Create team with different optional fields
CreateTopic create = create(test);
createAndCheckEntity(create, adminAuthHeaders());
@ -69,17 +69,17 @@ public class TopicResourceTest extends EntityResourceTest<Topic> {
}
@Test
public void post_topicWithUserOwner_200_ok(TestInfo test) throws IOException {
void post_topicWithUserOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(USER_OWNER1), adminAuthHeaders());
}
@Test
public void post_topicWithTeamOwner_200_ok(TestInfo test) throws IOException {
void post_topicWithTeamOwner_200_ok(TestInfo test) throws IOException {
createAndCheckEntity(create(test).withOwner(TEAM_OWNER1), adminAuthHeaders());
}
@Test
public void post_topic_as_non_admin_401(TestInfo test) {
void post_topic_as_non_admin_401(TestInfo test) {
CreateTopic create = create(test);
HttpResponseException exception =
assertThrows(HttpResponseException.class, () -> createTopic(create, authHeaders("test@open-metadata.org")));
@ -87,7 +87,7 @@ public class TopicResourceTest extends EntityResourceTest<Topic> {
}
@Test
public void post_topicWithoutRequiredFields_4xx(TestInfo test) {
void post_topicWithoutRequiredFields_4xx(TestInfo test) {
// Service is required field
HttpResponseException exception =
assertThrows(
@ -108,7 +108,7 @@ public class TopicResourceTest extends EntityResourceTest<Topic> {
}
@Test
public void post_topicWithDifferentService_200_ok(TestInfo test) throws IOException {
void post_topicWithDifferentService_200_ok(TestInfo test) throws IOException {
EntityReference[] differentServices = {PULSAR_REFERENCE, KAFKA_REFERENCE};
// Create topic for each service and test APIs
@ -130,7 +130,7 @@ public class TopicResourceTest extends EntityResourceTest<Topic> {
}
@Test
public void put_topicAttributes_200_ok(TestInfo test) throws IOException {
void put_topicAttributes_200_ok(TestInfo test) throws IOException {
CreateTopic createTopic =
create(test)
.withOwner(USER_OWNER1)
@ -183,7 +183,7 @@ public class TopicResourceTest extends EntityResourceTest<Topic> {
}
@Test
public void patch_topicAttributes_200_ok(TestInfo test) throws IOException {
void patch_topicAttributes_200_ok(TestInfo test) throws IOException {
CreateTopic createTopic =
create(test)
.withOwner(USER_OWNER1)
@ -239,13 +239,13 @@ public class TopicResourceTest extends EntityResourceTest<Topic> {
}
@Test
public void delete_emptyTopic_200_ok(TestInfo test) throws HttpResponseException {
void delete_emptyTopic_200_ok(TestInfo test) throws HttpResponseException {
Topic topic = createTopic(create(test), adminAuthHeaders());
deleteEntity(topic.getId(), adminAuthHeaders());
}
@Test
public void delete_nonEmptyTopic_4xx() {
void delete_nonEmptyTopic_4xx() {
// TODO
}

View file

@ -62,7 +62,7 @@ public class PolicyEvaluatorTest {
}
@Test
public void dataConsumer_cannot_update_owner() {
void dataConsumer_cannot_update_owner() {
User dataConsumer = createUser(ImmutableList.of(DATA_CONSUMER));
Table table = createTable();
boolean hasPermission = policyEvaluator.hasPermission(dataConsumer, table, MetadataOperation.UpdateOwner);
@ -70,7 +70,7 @@ public class PolicyEvaluatorTest {
}
@Test
public void dataSteward_can_update_owner() {
void dataSteward_can_update_owner() {
User dataConsumer = createUser(ImmutableList.of(DATA_STEWARD));
Table table = createTable();
boolean hasPermission = policyEvaluator.hasPermission(dataConsumer, table, MetadataOperation.UpdateOwner);
@ -78,7 +78,7 @@ public class PolicyEvaluatorTest {
}
@Test
public void dataConsumer_can_suggest_description() {
void dataConsumer_can_suggest_description() {
User dataConsumer = createUser(ImmutableList.of(DATA_CONSUMER));
Table table = createTable();
boolean hasPermission = policyEvaluator.hasPermission(dataConsumer, table, MetadataOperation.SuggestDescription);
@ -86,7 +86,7 @@ public class PolicyEvaluatorTest {
}
@Test
public void legal_can_update_tags_for_pii_tables() {
void legal_can_update_tags_for_pii_tables() {
User dataConsumer = createUser(ImmutableList.of(LEGAL));
Table table = createTable();
boolean hasPermission = policyEvaluator.hasPermission(dataConsumer, table, MetadataOperation.UpdateTags);
@ -94,7 +94,7 @@ public class PolicyEvaluatorTest {
}
@Test
public void auditor_cannot_update_tags_for_pii_tables() {
void auditor_cannot_update_tags_for_pii_tables() {
User dataConsumer = createUser(ImmutableList.of(AUDITOR));
Table table = createTable();
boolean hasPermission = policyEvaluator.hasPermission(dataConsumer, table, MetadataOperation.UpdateTags);
@ -102,7 +102,7 @@ public class PolicyEvaluatorTest {
}
@Test
public void devops_can_suggest_description() {
void devops_can_suggest_description() {
User dataConsumer = createUser(ImmutableList.of(DEV_OPS));
Table table = createTable();
boolean hasPermission = policyEvaluator.hasPermission(dataConsumer, table, MetadataOperation.SuggestDescription);
@ -110,7 +110,7 @@ public class PolicyEvaluatorTest {
}
@Test
public void devops_cannot_update_description() {
void devops_cannot_update_description() {
User dataConsumer = createUser(ImmutableList.of(DEV_OPS));
Table table = createTable();
boolean hasPermission = policyEvaluator.hasPermission(dataConsumer, table, MetadataOperation.UpdateDescription);
@ -118,7 +118,7 @@ public class PolicyEvaluatorTest {
}
@Test
public void devops_cannot_update_tags() {
void devops_cannot_update_tags() {
User dataConsumer = createUser(ImmutableList.of(DEV_OPS));
Table table = createTable();
boolean hasPermission = policyEvaluator.hasPermission(dataConsumer, table, MetadataOperation.UpdateTags);

View file

@ -32,7 +32,7 @@ import org.openmetadata.catalog.entity.teams.Team;
public class JsonUtilsTest {
/** Test apply patch method with different operations. */
@Test
public void applyPatch() throws IOException {
void applyPatch() throws IOException {
JsonObjectBuilder teamJson = Json.createObjectBuilder();
JsonObjectBuilder user1 = Json.createObjectBuilder();
JsonObjectBuilder user2 = Json.createObjectBuilder();

View file

@ -25,7 +25,7 @@ import org.openmetadata.catalog.entity.teams.User;
public class RestUtilTest {
@Test
public void testFields() {
void testFields() {
// Anonymous class with JsonProperties to extract
Object entity =
new Object() {

View file

@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test;
public class CipherTextTest {
@Test
public void encryptDescryptTest() throws GeneralSecurityException, UnsupportedEncodingException {
void encryptDescryptTest() throws GeneralSecurityException, UnsupportedEncodingException {
CipherText cipherText = CipherText.instance();
String[] strings = {"test1", "test2", "service.dwh.fact_trip", "random text", "user@domain.com"};
for (String str : strings) {