From 717220b17bd698554385b23f909bcfcd50d1e5bb Mon Sep 17 00:00:00 2001 From: itsankit-google Date: Wed, 13 Sep 2023 10:21:03 +0000 Subject: [PATCH] PLUGIN-1681: Add macro support back for database config in postgres connector --- .../postgresql/source/PostgresqlDesignTimeWithMacro.feature | 2 +- .../java/io/cdap/plugin/postgres/PostgresConnectorConfig.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/postgresql-plugin/src/e2e-test/features/postgresql/source/PostgresqlDesignTimeWithMacro.feature b/postgresql-plugin/src/e2e-test/features/postgresql/source/PostgresqlDesignTimeWithMacro.feature index 3147ce3e3..0b2f9d5ad 100644 --- a/postgresql-plugin/src/e2e-test/features/postgresql/source/PostgresqlDesignTimeWithMacro.feature +++ b/postgresql-plugin/src/e2e-test/features/postgresql/source/PostgresqlDesignTimeWithMacro.feature @@ -28,7 +28,7 @@ Feature: PostgreSQL source- Verify PostgreSQL source plugin design time macro sc Then Click on the Macro button of Property: "user" and set the value to: "postGreSQLUser" Then Click on the Macro button of Property: "password" and set the value to: "postGreSQLPassword" Then Click on the Macro button of Property: "connectionArguments" and set the value to: "postGreSQLConnectionArguments" - Then Replace input plugin property: "database" with value: "databaseName" + Then Click on the Macro button of Property: "database" and set the value to: "postGreSQLDatabase" Then Enter input plugin property: "referenceName" with value: "sourceRef" Then Enter textarea plugin property: "importQuery" with value: "selectQuery" Then Validate "PostgreSQL" plugin properties diff --git a/postgresql-plugin/src/main/java/io/cdap/plugin/postgres/PostgresConnectorConfig.java b/postgresql-plugin/src/main/java/io/cdap/plugin/postgres/PostgresConnectorConfig.java index 3b34281a8..2688d14ed 100644 --- a/postgresql-plugin/src/main/java/io/cdap/plugin/postgres/PostgresConnectorConfig.java +++ b/postgresql-plugin/src/main/java/io/cdap/plugin/postgres/PostgresConnectorConfig.java @@ -17,6 +17,7 @@ package io.cdap.plugin.postgres; import io.cdap.cdap.api.annotation.Description; +import io.cdap.cdap.api.annotation.Macro; import io.cdap.cdap.api.annotation.Name; import io.cdap.plugin.db.connector.AbstractDBSpecificConnectorConfig; @@ -38,6 +39,7 @@ public PostgresConnectorConfig(String host, int port, String user, String passwo @Name(NAME_DATABASE) @Description("Database to connect to.") + @Macro private String database; @Override