Fixes #1552 Use logger from the base class CatalogApplicationTest in all the Resource tests (#1553)

Co-authored-by: sureshms <suresh@getcollate.io>
This commit is contained in:
Suresh Srinivas 2021-12-04 11:44:29 -08:00 committed by GitHub
parent 63a93c8944
commit fc58c9f5ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 6 additions and 26 deletions

View File

@ -31,7 +31,7 @@ import javax.ws.rs.client.WebTarget;
@ExtendWith(EmbeddedMySqlSupport.class)
@ExtendWith(DropwizardExtensionsSupport.class)
public abstract class CatalogApplicationTest {
private static final Logger LOG = LoggerFactory.getLogger(CatalogApplicationTest.class);
public static final Logger LOG = LoggerFactory.getLogger(CatalogApplicationTest.class);
private static final String CONFIG_PATH;
public static final DropwizardAppExtension<CatalogApplicationConfig> APP;

View File

@ -23,8 +23,6 @@ import java.util.Map;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
public class CollectionRegistryTest {
private static final Logger LOG = LoggerFactory.getLogger(CollectionRegistryTest.class);
@Test
public void testCollections() {
CollectionRegistry.getInstance();

View File

@ -57,8 +57,6 @@ import org.openmetadata.catalog.util.RestUtil;
import org.openmetadata.catalog.util.ResultList;
import org.openmetadata.catalog.util.TestUtils;
import org.openmetadata.common.utils.JsonSchemaUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.json.JsonPatch;
import javax.ws.rs.client.WebTarget;
@ -99,7 +97,6 @@ import static org.openmetadata.catalog.util.TestUtils.checkUserFollowing;
import static org.openmetadata.catalog.util.TestUtils.userAuthHeaders;
public abstract class EntityResourceTest<T> extends CatalogApplicationTest {
private static final Logger LOG = LoggerFactory.getLogger(EntityResourceTest.class);
private final String entityName;
private final Class<T> entityClass;
private final Class<? extends ResultList<T>> entityListClass;

View File

@ -38,11 +38,8 @@ import org.openmetadata.catalog.resources.databases.TableResource.TableList;
import org.openmetadata.catalog.resources.services.DatabaseServiceResourceTest;
import org.openmetadata.catalog.resources.services.StorageServiceResourceTest;
import org.openmetadata.catalog.resources.tags.TagResourceTest;
import org.openmetadata.catalog.type.StorageServiceType;
import org.openmetadata.catalog.type.Column;
import org.openmetadata.catalog.type.SQLQuery;
import org.openmetadata.catalog.type.TableConstraint.ConstraintType;
import org.openmetadata.catalog.type.ChangeDescription;
import org.openmetadata.catalog.type.Column;
import org.openmetadata.catalog.type.ColumnConstraint;
import org.openmetadata.catalog.type.ColumnDataType;
import org.openmetadata.catalog.type.ColumnJoin;
@ -50,7 +47,10 @@ import org.openmetadata.catalog.type.ColumnProfile;
import org.openmetadata.catalog.type.EntityReference;
import org.openmetadata.catalog.type.FieldChange;
import org.openmetadata.catalog.type.JoinedWith;
import org.openmetadata.catalog.type.SQLQuery;
import org.openmetadata.catalog.type.StorageServiceType;
import org.openmetadata.catalog.type.TableConstraint;
import org.openmetadata.catalog.type.TableConstraint.ConstraintType;
import org.openmetadata.catalog.type.TableData;
import org.openmetadata.catalog.type.TableJoins;
import org.openmetadata.catalog.type.TableProfile;
@ -61,8 +61,6 @@ import org.openmetadata.catalog.util.JsonUtils;
import org.openmetadata.catalog.util.RestUtil;
import org.openmetadata.catalog.util.ResultList;
import org.openmetadata.catalog.util.TestUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response.Status;
@ -112,7 +110,6 @@ import static org.openmetadata.common.utils.CommonUtil.getDateStringByOffset;
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public class TableResourceTest extends EntityResourceTest<Table> {
private static final Logger LOG = LoggerFactory.getLogger(TableResourceTest.class);
public static Database DATABASE;
public static List<Column> COLUMNS;

View File

@ -24,8 +24,8 @@ import org.openmetadata.catalog.CatalogApplicationTest;
import org.openmetadata.catalog.Entity;
import org.openmetadata.catalog.api.data.CreateDatabase;
import org.openmetadata.catalog.api.data.CreateDbtModel;
import org.openmetadata.catalog.entity.data.DbtModel;
import org.openmetadata.catalog.entity.data.Database;
import org.openmetadata.catalog.entity.data.DbtModel;
import org.openmetadata.catalog.entity.services.DatabaseService;
import org.openmetadata.catalog.exception.CatalogExceptionMessage;
import org.openmetadata.catalog.jdbi3.DbtModelRepository.DbtModelEntityInterface;
@ -45,8 +45,6 @@ import org.openmetadata.catalog.util.EntityUtil.Fields;
import org.openmetadata.catalog.util.JsonUtils;
import org.openmetadata.catalog.util.ResultList;
import org.openmetadata.catalog.util.TestUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response.Status;
@ -91,7 +89,6 @@ import static org.openmetadata.catalog.util.TestUtils.userAuthHeaders;
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public class DbtModelResourceTest extends EntityResourceTest<DbtModel> {
private static final Logger LOG = LoggerFactory.getLogger(DbtModelResourceTest.class);
public static Database DATABASE;
public static final List<Column> COLUMNS = Arrays.asList(

View File

@ -40,8 +40,6 @@ import org.openmetadata.catalog.type.TagLabel;
import org.openmetadata.catalog.util.JsonUtils;
import org.openmetadata.catalog.util.TestUtils;
import org.openmetadata.common.utils.JsonSchemaUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.json.JsonPatch;
import javax.ws.rs.client.WebTarget;
@ -75,7 +73,6 @@ import static org.openmetadata.catalog.util.TestUtils.existsInEntityReferenceLis
import static org.openmetadata.catalog.util.TestUtils.userAuthHeaders;
public class LocationResourceTest extends CatalogApplicationTest {
private static final Logger LOG = LoggerFactory.getLogger(LocationResourceTest.class);
public static User USER1;
public static EntityReference USER_OWNER1;
public static Team TEAM1;

View File

@ -30,8 +30,6 @@ import org.openmetadata.catalog.type.Tag;
import org.openmetadata.catalog.type.TagCategory;
import org.openmetadata.catalog.util.JsonUtils;
import org.openmetadata.catalog.util.TestUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response.Status;
@ -58,7 +56,6 @@ import static org.openmetadata.catalog.util.TestUtils.authHeaders;
*/
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public class TagResourceTest extends CatalogApplicationTest {
public static final Logger LOG = LoggerFactory.getLogger(TagResourceTest.class);
public static String BASE_URL;
@BeforeAll

View File

@ -34,8 +34,6 @@ import org.openmetadata.catalog.type.EntityUsage;
import org.openmetadata.catalog.type.UsageDetails;
import org.openmetadata.catalog.util.RestUtil;
import org.openmetadata.catalog.util.TestUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ws.rs.client.WebTarget;
import java.io.IOException;
@ -60,7 +58,6 @@ import static org.openmetadata.common.utils.CommonUtil.getDateStringByOffset;
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public class UsageResourceTest extends CatalogApplicationTest {
private static final Logger LOG = LoggerFactory.getLogger(UsageResourceTest.class);
public static final List<Table> TABLES = new ArrayList<>();
public static final int TABLE_COUNT = 10;
public static final int DAYS_OF_USAGE = 32;