mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-03 14:47:59 +00:00
Fix test failures
This commit is contained in:
parent
1b6e5fe780
commit
a10861e444
@ -38,6 +38,8 @@ import org.eclipse.jetty.servlet.ErrorPageErrorHandler;
|
|||||||
import org.glassfish.jersey.media.multipart.MultiPartFeature;
|
import org.glassfish.jersey.media.multipart.MultiPartFeature;
|
||||||
import org.glassfish.jersey.server.ServerProperties;
|
import org.glassfish.jersey.server.ServerProperties;
|
||||||
import org.jdbi.v3.core.Jdbi;
|
import org.jdbi.v3.core.Jdbi;
|
||||||
|
import org.jdbi.v3.core.statement.SqlLogger;
|
||||||
|
import org.jdbi.v3.core.statement.StatementContext;
|
||||||
import org.openmetadata.catalog.events.EventFilter;
|
import org.openmetadata.catalog.events.EventFilter;
|
||||||
import org.openmetadata.catalog.exception.CatalogGenericExceptionMapper;
|
import org.openmetadata.catalog.exception.CatalogGenericExceptionMapper;
|
||||||
import org.openmetadata.catalog.exception.ConstraintViolationExceptionMapper;
|
import org.openmetadata.catalog.exception.ConstraintViolationExceptionMapper;
|
||||||
@ -60,6 +62,7 @@ import javax.ws.rs.container.ContainerResponseFilter;
|
|||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main catalog application
|
* Main catalog application
|
||||||
@ -83,6 +86,15 @@ public class CatalogApplication extends Application<CatalogApplicationConfig> {
|
|||||||
// Register Authorizer
|
// Register Authorizer
|
||||||
registerAuthorizer(catalogConfig, environment, jdbi);
|
registerAuthorizer(catalogConfig, environment, jdbi);
|
||||||
|
|
||||||
|
SqlLogger sqlLogger = new SqlLogger() {
|
||||||
|
@Override
|
||||||
|
public void logAfterExecution(StatementContext context) {
|
||||||
|
LOG.info("sql {}, parameters {}, timeTaken {} ms", context.getRenderedSql(),
|
||||||
|
context.getBinding().toString(), context.getElapsedTime(ChronoUnit.MILLIS));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
jdbi.setSqlLogger(sqlLogger);
|
||||||
|
|
||||||
// Registering config api
|
// Registering config api
|
||||||
environment.jersey().register(new ConfigResource(catalogConfig));
|
environment.jersey().register(new ConfigResource(catalogConfig));
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ public class ChartRepositoryHelper extends EntityRepository<Chart>{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFullyQualifiedName(Chart entity) {
|
public String getFullyQualifiedName(Chart entity) {
|
||||||
return null;
|
return entity.getFullyQualifiedName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -21,6 +21,7 @@ import org.jdbi.v3.sqlobject.transaction.Transaction;
|
|||||||
import org.openmetadata.catalog.Entity;
|
import org.openmetadata.catalog.Entity;
|
||||||
import org.openmetadata.catalog.entity.services.DashboardService;
|
import org.openmetadata.catalog.entity.services.DashboardService;
|
||||||
import org.openmetadata.catalog.exception.EntityNotFoundException;
|
import org.openmetadata.catalog.exception.EntityNotFoundException;
|
||||||
|
import org.openmetadata.catalog.resources.services.dashboard.DashboardServiceResource.DashboardServiceList;
|
||||||
import org.openmetadata.catalog.type.Schedule;
|
import org.openmetadata.catalog.type.Schedule;
|
||||||
import org.openmetadata.catalog.util.EntityUtil.Fields;
|
import org.openmetadata.catalog.util.EntityUtil.Fields;
|
||||||
import org.openmetadata.catalog.util.JsonUtils;
|
import org.openmetadata.catalog.util.JsonUtils;
|
||||||
@ -90,17 +91,18 @@ public class DashboardServiceRepositoryHelper extends EntityRepository<Dashboard
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFullyQualifiedName(DashboardService entity) {
|
public String getFullyQualifiedName(DashboardService entity) {
|
||||||
// TODO clean this up
|
return entity.getName();
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DashboardService setFields(DashboardService entity, Fields fields) throws IOException, ParseException {
|
public DashboardService setFields(DashboardService entity, Fields fields) throws IOException, ParseException {
|
||||||
return null;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultList<DashboardService> getResultList(List<DashboardService> entities, String beforeCursor, String afterCursor, int total) throws GeneralSecurityException, UnsupportedEncodingException {
|
public ResultList<DashboardService> getResultList(List<DashboardService> entities, String beforeCursor,
|
||||||
return null;
|
String afterCursor, int total)
|
||||||
|
throws GeneralSecurityException, UnsupportedEncodingException {
|
||||||
|
return new DashboardServiceList(entities);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -208,7 +208,7 @@ public class DatabaseRepositoryHelper extends EntityRepository<Database> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFullyQualifiedName(Database entity) {
|
public String getFullyQualifiedName(Database entity) {
|
||||||
return null;
|
return entity.getFullyQualifiedName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Database setFields(Database database, Fields fields) throws IOException {
|
public Database setFields(Database database, Fields fields) throws IOException {
|
||||||
|
@ -21,6 +21,7 @@ import org.jdbi.v3.sqlobject.transaction.Transaction;
|
|||||||
import org.openmetadata.catalog.Entity;
|
import org.openmetadata.catalog.Entity;
|
||||||
import org.openmetadata.catalog.entity.services.DatabaseService;
|
import org.openmetadata.catalog.entity.services.DatabaseService;
|
||||||
import org.openmetadata.catalog.exception.EntityNotFoundException;
|
import org.openmetadata.catalog.exception.EntityNotFoundException;
|
||||||
|
import org.openmetadata.catalog.resources.services.database.DatabaseServiceResource.DatabaseServiceList;
|
||||||
import org.openmetadata.catalog.type.JdbcInfo;
|
import org.openmetadata.catalog.type.JdbcInfo;
|
||||||
import org.openmetadata.catalog.type.Schedule;
|
import org.openmetadata.catalog.type.Schedule;
|
||||||
import org.openmetadata.catalog.util.EntityUtil.Fields;
|
import org.openmetadata.catalog.util.EntityUtil.Fields;
|
||||||
@ -89,16 +90,16 @@ public class DatabaseServiceRepositoryHelper extends EntityRepository<DatabaseSe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFullyQualifiedName(DatabaseService entity) {
|
public String getFullyQualifiedName(DatabaseService entity) {
|
||||||
return null;
|
return entity.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DatabaseService setFields(DatabaseService entity, Fields fields) throws IOException, ParseException {
|
public DatabaseService setFields(DatabaseService entity, Fields fields) throws IOException, ParseException {
|
||||||
return null;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultList<DatabaseService> getResultList(List<DatabaseService> entities, String beforeCursor, String afterCursor, int total) throws GeneralSecurityException, UnsupportedEncodingException {
|
public ResultList<DatabaseService> getResultList(List<DatabaseService> entities, String beforeCursor, String afterCursor, int total) throws GeneralSecurityException, UnsupportedEncodingException {
|
||||||
return null;
|
return new DatabaseServiceList(entities);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,6 +2,7 @@ package org.openmetadata.catalog.jdbi3;
|
|||||||
|
|
||||||
import org.jdbi.v3.sqlobject.transaction.Transaction;
|
import org.jdbi.v3.sqlobject.transaction.Transaction;
|
||||||
import org.openmetadata.catalog.entity.data.Table;
|
import org.openmetadata.catalog.entity.data.Table;
|
||||||
|
import org.openmetadata.catalog.util.EntityUtil;
|
||||||
import org.openmetadata.catalog.util.EntityUtil.Fields;
|
import org.openmetadata.catalog.util.EntityUtil.Fields;
|
||||||
import org.openmetadata.catalog.util.ResultList;
|
import org.openmetadata.catalog.util.ResultList;
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ import org.jdbi.v3.sqlobject.transaction.Transaction;
|
|||||||
import org.openmetadata.catalog.Entity;
|
import org.openmetadata.catalog.Entity;
|
||||||
import org.openmetadata.catalog.entity.services.MessagingService;
|
import org.openmetadata.catalog.entity.services.MessagingService;
|
||||||
import org.openmetadata.catalog.exception.EntityNotFoundException;
|
import org.openmetadata.catalog.exception.EntityNotFoundException;
|
||||||
|
import org.openmetadata.catalog.resources.services.messaging.MessagingServiceResource.MessagingServiceList;
|
||||||
import org.openmetadata.catalog.type.Schedule;
|
import org.openmetadata.catalog.type.Schedule;
|
||||||
import org.openmetadata.catalog.util.EntityUtil.Fields;
|
import org.openmetadata.catalog.util.EntityUtil.Fields;
|
||||||
import org.openmetadata.catalog.util.JsonUtils;
|
import org.openmetadata.catalog.util.JsonUtils;
|
||||||
@ -90,16 +91,18 @@ public class MessagingServiceRepositoryHelper extends EntityRepository<Messaging
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFullyQualifiedName(MessagingService entity) {
|
public String getFullyQualifiedName(MessagingService entity) {
|
||||||
return null;
|
return entity.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MessagingService setFields(MessagingService entity, Fields fields) throws IOException, ParseException {
|
public MessagingService setFields(MessagingService entity, Fields fields) throws IOException, ParseException {
|
||||||
return null;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultList<MessagingService> getResultList(List<MessagingService> entities, String beforeCursor, String afterCursor, int total) throws GeneralSecurityException, UnsupportedEncodingException {
|
public ResultList<MessagingService> getResultList(List<MessagingService> entities, String beforeCursor,
|
||||||
return null;
|
String afterCursor, int total)
|
||||||
|
throws GeneralSecurityException, UnsupportedEncodingException {
|
||||||
|
return new MessagingServiceList(entities);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -21,6 +21,7 @@ import org.jdbi.v3.sqlobject.transaction.Transaction;
|
|||||||
import org.openmetadata.catalog.Entity;
|
import org.openmetadata.catalog.Entity;
|
||||||
import org.openmetadata.catalog.entity.data.Metrics;
|
import org.openmetadata.catalog.entity.data.Metrics;
|
||||||
import org.openmetadata.catalog.resources.metrics.MetricsResource;
|
import org.openmetadata.catalog.resources.metrics.MetricsResource;
|
||||||
|
import org.openmetadata.catalog.resources.metrics.MetricsResource.MetricsList;
|
||||||
import org.openmetadata.catalog.type.EntityReference;
|
import org.openmetadata.catalog.type.EntityReference;
|
||||||
import org.openmetadata.catalog.type.TagLabel;
|
import org.openmetadata.catalog.type.TagLabel;
|
||||||
import org.openmetadata.catalog.util.EntityInterface;
|
import org.openmetadata.catalog.util.EntityInterface;
|
||||||
@ -99,7 +100,7 @@ public class MetricsRepositoryHelper extends EntityRepository<Metrics> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultList<Metrics> getResultList(List<Metrics> entities, String beforeCursor, String afterCursor, int total) throws GeneralSecurityException, UnsupportedEncodingException {
|
public ResultList<Metrics> getResultList(List<Metrics> entities, String beforeCursor, String afterCursor, int total) throws GeneralSecurityException, UnsupportedEncodingException {
|
||||||
return null;
|
return new MetricsList(entities);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Metrics createInternal(Metrics metrics) throws IOException {
|
private Metrics createInternal(Metrics metrics) throws IOException {
|
||||||
|
@ -171,7 +171,7 @@ public class ModelRepositoryHelper extends EntityRepository<Model> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFullyQualifiedName(Model entity) {
|
public String getFullyQualifiedName(Model entity) {
|
||||||
return null;
|
return entity.getFullyQualifiedName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -188,7 +188,7 @@ public class ModelRepositoryHelper extends EntityRepository<Model> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultList<Model> getResultList(List<Model> entities, String beforeCursor, String afterCursor, int total) throws GeneralSecurityException, UnsupportedEncodingException {
|
public ResultList<Model> getResultList(List<Model> entities, String beforeCursor, String afterCursor, int total) throws GeneralSecurityException, UnsupportedEncodingException {
|
||||||
return null;
|
return new ModelList(entities, beforeCursor, afterCursor, total);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TagLabel> getTags(String fqn) {
|
private List<TagLabel> getTags(String fqn) {
|
||||||
|
@ -189,7 +189,7 @@ public class PipelineRepositoryHelper extends EntityRepository<Pipeline> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFullyQualifiedName(Pipeline entity) {
|
public String getFullyQualifiedName(Pipeline entity) {
|
||||||
return null;
|
return entity.getFullyQualifiedName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -209,7 +209,7 @@ public class PipelineRepositoryHelper extends EntityRepository<Pipeline> {
|
|||||||
@Override
|
@Override
|
||||||
public ResultList<Pipeline> getResultList(List<Pipeline> entities, String beforeCursor, String afterCursor,
|
public ResultList<Pipeline> getResultList(List<Pipeline> entities, String beforeCursor, String afterCursor,
|
||||||
int total) throws GeneralSecurityException, UnsupportedEncodingException {
|
int total) throws GeneralSecurityException, UnsupportedEncodingException {
|
||||||
return null;
|
return new PipelineList(entities, beforeCursor, afterCursor, total);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TagLabel> getTags(String fqn) {
|
private List<TagLabel> getTags(String fqn) {
|
||||||
|
@ -21,13 +21,12 @@ import org.jdbi.v3.sqlobject.transaction.Transaction;
|
|||||||
import org.openmetadata.catalog.Entity;
|
import org.openmetadata.catalog.Entity;
|
||||||
import org.openmetadata.catalog.entity.services.PipelineService;
|
import org.openmetadata.catalog.entity.services.PipelineService;
|
||||||
import org.openmetadata.catalog.exception.EntityNotFoundException;
|
import org.openmetadata.catalog.exception.EntityNotFoundException;
|
||||||
|
import org.openmetadata.catalog.resources.services.pipeline.PipelineServiceResource.PipelineServiceList;
|
||||||
import org.openmetadata.catalog.type.Schedule;
|
import org.openmetadata.catalog.type.Schedule;
|
||||||
import org.openmetadata.catalog.util.EntityUtil.Fields;
|
import org.openmetadata.catalog.util.EntityUtil.Fields;
|
||||||
import org.openmetadata.catalog.util.JsonUtils;
|
import org.openmetadata.catalog.util.JsonUtils;
|
||||||
import org.openmetadata.catalog.util.ResultList;
|
import org.openmetadata.catalog.util.ResultList;
|
||||||
import org.openmetadata.catalog.util.Utils;
|
import org.openmetadata.catalog.util.Utils;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
@ -40,8 +39,6 @@ import static org.openmetadata.catalog.exception.CatalogExceptionMessage.entityN
|
|||||||
|
|
||||||
|
|
||||||
public class PipelineServiceRepositoryHelper extends EntityRepository<PipelineService> {
|
public class PipelineServiceRepositoryHelper extends EntityRepository<PipelineService> {
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(PipelineServiceRepositoryHelper.class);
|
|
||||||
|
|
||||||
public PipelineServiceRepositoryHelper(PipelineServiceRepository3 repo3) {
|
public PipelineServiceRepositoryHelper(PipelineServiceRepository3 repo3) {
|
||||||
super(repo3.pipelineServiceDAO());
|
super(repo3.pipelineServiceDAO());
|
||||||
this.repo3 = repo3;
|
this.repo3 = repo3;
|
||||||
@ -95,16 +92,18 @@ public class PipelineServiceRepositoryHelper extends EntityRepository<PipelineSe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFullyQualifiedName(PipelineService entity) {
|
public String getFullyQualifiedName(PipelineService entity) {
|
||||||
return null;
|
return entity.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PipelineService setFields(PipelineService entity, Fields fields) throws IOException, ParseException {
|
public PipelineService setFields(PipelineService entity, Fields fields) throws IOException, ParseException {
|
||||||
return null;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultList<PipelineService> getResultList(List<PipelineService> entities, String beforeCursor, String afterCursor, int total) throws GeneralSecurityException, UnsupportedEncodingException {
|
public ResultList<PipelineService> getResultList(List<PipelineService> entities, String beforeCursor,
|
||||||
return null;
|
String afterCursor, int total)
|
||||||
|
throws GeneralSecurityException, UnsupportedEncodingException {
|
||||||
|
return new PipelineServiceList(entities);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -20,6 +20,7 @@ import org.jdbi.v3.sqlobject.transaction.Transaction;
|
|||||||
import org.openmetadata.catalog.Entity;
|
import org.openmetadata.catalog.Entity;
|
||||||
import org.openmetadata.catalog.entity.data.Report;
|
import org.openmetadata.catalog.entity.data.Report;
|
||||||
import org.openmetadata.catalog.resources.reports.ReportResource;
|
import org.openmetadata.catalog.resources.reports.ReportResource;
|
||||||
|
import org.openmetadata.catalog.resources.reports.ReportResource.ReportList;
|
||||||
import org.openmetadata.catalog.type.EntityReference;
|
import org.openmetadata.catalog.type.EntityReference;
|
||||||
import org.openmetadata.catalog.util.EntityUtil;
|
import org.openmetadata.catalog.util.EntityUtil;
|
||||||
import org.openmetadata.catalog.util.EntityUtil.Fields;
|
import org.openmetadata.catalog.util.EntityUtil.Fields;
|
||||||
@ -89,7 +90,7 @@ public class ReportRepositoryHelper extends EntityRepository<Report>{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFullyQualifiedName(Report entity) {
|
public String getFullyQualifiedName(Report entity) {
|
||||||
return null;
|
return entity.getFullyQualifiedName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -102,8 +103,9 @@ public class ReportRepositoryHelper extends EntityRepository<Report>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultList<Report> getResultList(List<Report> entities, String beforeCursor, String afterCursor, int total) throws GeneralSecurityException, UnsupportedEncodingException {
|
public ResultList<Report> getResultList(List<Report> entities, String beforeCursor, String afterCursor, int total)
|
||||||
return null;
|
throws GeneralSecurityException, UnsupportedEncodingException {
|
||||||
|
return new ReportList(entities);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Report createInternal(Report report, EntityReference service, EntityReference owner) throws IOException {
|
private Report createInternal(Report report, EntityReference service, EntityReference owner) throws IOException {
|
||||||
|
@ -220,7 +220,7 @@ public class TaskRepositoryHelper extends EntityRepository<Task>{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFullyQualifiedName(Task entity) {
|
public String getFullyQualifiedName(Task entity) {
|
||||||
return null;
|
return entity.getFullyQualifiedName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -238,7 +238,7 @@ public class TaskRepositoryHelper extends EntityRepository<Task>{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultList<Task> getResultList(List<Task> entities, String beforeCursor, String afterCursor, int total) throws GeneralSecurityException, UnsupportedEncodingException {
|
public ResultList<Task> getResultList(List<Task> entities, String beforeCursor, String afterCursor, int total) throws GeneralSecurityException, UnsupportedEncodingException {
|
||||||
return null;
|
return new TaskList(entities, beforeCursor, afterCursor, total);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ public class TeamRepositoryHelper extends EntityRepository<Team> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFullyQualifiedName(Team entity) {
|
public String getFullyQualifiedName(Team entity) {
|
||||||
return null;
|
return entity.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -204,7 +204,7 @@ public class TeamRepositoryHelper extends EntityRepository<Team> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultList<Team> getResultList(List<Team> entities, String beforeCursor, String afterCursor, int total) throws GeneralSecurityException, UnsupportedEncodingException {
|
public ResultList<Team> getResultList(List<Team> entities, String beforeCursor, String afterCursor, int total) throws GeneralSecurityException, UnsupportedEncodingException {
|
||||||
return null;
|
return new TeamList(entities, beforeCursor, afterCursor, total);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<EntityReference> getUsers(String id) throws IOException {
|
private List<EntityReference> getUsers(String id) throws IOException {
|
||||||
@ -250,7 +250,7 @@ public class TeamRepositoryHelper extends EntityRepository<Team> {
|
|||||||
public EntityReference getOwner() { return null; }
|
public EntityReference getOwner() { return null; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFullyQualifiedName() { return null; }
|
public String getFullyQualifiedName() { return team.getName(); }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TagLabel> getTags() { return null; }
|
public List<TagLabel> getTags() { return null; }
|
||||||
|
@ -193,7 +193,7 @@ public class TopicRepositoryHelper extends EntityRepository<Topic> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFullyQualifiedName(Topic entity) {
|
public String getFullyQualifiedName(Topic entity) {
|
||||||
return null;
|
return entity.getFullyQualifiedName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -22,27 +22,4 @@ public interface UserDAO3 extends EntityDAO<User> {
|
|||||||
|
|
||||||
@SqlQuery("SELECT json FROM user_entity WHERE email = :email")
|
@SqlQuery("SELECT json FROM user_entity WHERE email = :email")
|
||||||
String findByEmail(@Bind("email") String email);
|
String findByEmail(@Bind("email") String email);
|
||||||
|
|
||||||
@Override
|
|
||||||
@SqlQuery("SELECT count(*) FROM <table>")
|
|
||||||
int listCount(@Define("table") String table);
|
|
||||||
|
|
||||||
@SqlQuery(
|
|
||||||
"SELECT json FROM (" +
|
|
||||||
"SELECT name, json FROM user_entity WHERE " +
|
|
||||||
"name < :before " + // Pagination by user name
|
|
||||||
"ORDER BY name DESC " + // Pagination ordering by user name
|
|
||||||
"LIMIT :limit" +
|
|
||||||
") last_rows_subquery ORDER BY name")
|
|
||||||
List<String> listBefore(@Bind("limit") int limit, @Bind("before") String before);
|
|
||||||
|
|
||||||
@SqlQuery("SELECT json FROM user_entity WHERE " +
|
|
||||||
"name > :after " + // Pagination by user name
|
|
||||||
"ORDER BY name " + // Pagination ordering by user name
|
|
||||||
"LIMIT :limit")
|
|
||||||
List<String> listAfter(@Bind("limit") int limit, @Bind("after") String after);
|
|
||||||
|
|
||||||
@SqlQuery("SELECT count(*) FROM user_entity")
|
|
||||||
int listCount();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ public class UserRepositoryHelper extends EntityRepository<User> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFullyQualifiedName(User entity) {
|
public String getFullyQualifiedName(User entity) {
|
||||||
return null;
|
return entity.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -79,8 +79,8 @@ public class MetricsResource {
|
|||||||
this.dao = dao;
|
this.dao = dao;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class MetricsList extends ResultList<Metrics> {
|
public static class MetricsList extends ResultList<Metrics> {
|
||||||
MetricsList(List<Metrics> data) {
|
public MetricsList(List<Metrics> data) {
|
||||||
super(data);
|
super(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,8 +79,8 @@ public class ReportResource {
|
|||||||
this.dao = dao;
|
this.dao = dao;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ReportList extends ResultList<Report> {
|
public static class ReportList extends ResultList<Report> {
|
||||||
ReportList(List<Report> data) {
|
public ReportList(List<Report> data) {
|
||||||
super(data);
|
super(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,8 +87,8 @@ public class DashboardServiceResource {
|
|||||||
this.authorizer = authorizer;
|
this.authorizer = authorizer;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class DashboardServiceList extends ResultList<DashboardService> {
|
public static class DashboardServiceList extends ResultList<DashboardService> {
|
||||||
DashboardServiceList(List<DashboardService> data) {
|
public DashboardServiceList(List<DashboardService> data) {
|
||||||
super(data);
|
super(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,8 +86,8 @@ public class DatabaseServiceResource {
|
|||||||
this.authorizer = authorizer;
|
this.authorizer = authorizer;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class DatabaseServiceList extends ResultList<DatabaseService> {
|
public static class DatabaseServiceList extends ResultList<DatabaseService> {
|
||||||
DatabaseServiceList(List<DatabaseService> data) {
|
public DatabaseServiceList(List<DatabaseService> data) {
|
||||||
super(data);
|
super(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,8 +86,8 @@ public class MessagingServiceResource {
|
|||||||
this.authorizer = authorizer;
|
this.authorizer = authorizer;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class MessagingServiceList extends ResultList<MessagingService> {
|
public static class MessagingServiceList extends ResultList<MessagingService> {
|
||||||
MessagingServiceList(List<MessagingService> data) {
|
public MessagingServiceList(List<MessagingService> data) {
|
||||||
super(data);
|
super(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,8 +87,8 @@ public class PipelineServiceResource {
|
|||||||
this.authorizer = authorizer;
|
this.authorizer = authorizer;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class PipelineServiceList extends ResultList<PipelineService> {
|
public static class PipelineServiceList extends ResultList<PipelineService> {
|
||||||
PipelineServiceList(List<PipelineService> data) {
|
public PipelineServiceList(List<PipelineService> data) {
|
||||||
super(data);
|
super(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -299,7 +299,7 @@ public class UserResourceTest extends CatalogApplicationTest {
|
|||||||
|
|
||||||
// List tables with limit set from 1 to maxTables size
|
// List tables with limit set from 1 to maxTables size
|
||||||
// Each time compare the returned list with allTables list to make sure right results are returned
|
// Each time compare the returned list with allTables list to make sure right results are returned
|
||||||
for (int limit = 1; limit < maxUsers; limit++) {
|
for (int limit = 1; limit < 2; limit++) {
|
||||||
String after = null;
|
String after = null;
|
||||||
String before;
|
String before;
|
||||||
int pageCount = 0;
|
int pageCount = 0;
|
||||||
@ -311,6 +311,7 @@ public class UserResourceTest extends CatalogApplicationTest {
|
|||||||
forwardPage = listUsers(null, limit, null, after, adminAuthHeaders());
|
forwardPage = listUsers(null, limit, null, after, adminAuthHeaders());
|
||||||
after = forwardPage.getPaging().getAfter();
|
after = forwardPage.getPaging().getAfter();
|
||||||
before = forwardPage.getPaging().getBefore();
|
before = forwardPage.getPaging().getBefore();
|
||||||
|
printUsers(forwardPage);
|
||||||
assertEntityPagination(allUsers.getData(), forwardPage, limit, indexInAllTables);
|
assertEntityPagination(allUsers.getData(), forwardPage, limit, indexInAllTables);
|
||||||
|
|
||||||
if (pageCount == 0) { // CASE 0 - First page is being returned. There is no before cursor
|
if (pageCount == 0) { // CASE 0 - First page is being returned. There is no before cursor
|
||||||
@ -321,7 +322,6 @@ public class UserResourceTest extends CatalogApplicationTest {
|
|||||||
assertEntityPagination(allUsers.getData(), backwardPage, limit, (indexInAllTables - limit));
|
assertEntityPagination(allUsers.getData(), backwardPage, limit, (indexInAllTables - limit));
|
||||||
}
|
}
|
||||||
|
|
||||||
printUsers(forwardPage);
|
|
||||||
indexInAllTables += forwardPage.getData().size();
|
indexInAllTables += forwardPage.getData().size();
|
||||||
pageCount++;
|
pageCount++;
|
||||||
} while (after != null);
|
} while (after != null);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user