@@ -26,8 +26,9 @@ import (
2626)
2727
2828var (
29- JmsJdReportTimeStartedTime = time .Now ().AddDate (0 , - 1 , 0 ).UTC ()
30- JmsJdReportTimeStarted = JmsJdReportTimeStartedTime .Format (time .RFC3339 )
29+ JmsJavaDownloadsJavaDownloadReportResourceDependencies = DefinedTagsDependencies
30+ JmsJdReportTimeStartedTime = time .Now ().AddDate (0 , - 1 , 0 ).UTC ()
31+ JmsJdReportTimeStarted = JmsJdReportTimeStartedTime .Format (time .RFC3339 )
3132
3233 JmsJdReportTimeEndedTime = time .Now ().UTC ()
3334 JmsJdReportTimeEnded = JmsJdReportTimeEndedTime .Format (time .RFC3339 )
4647 Create : `${oci_jms_java_downloads_java_download_report.test_java_download_report.id}` },
4748 "state" : acctest.Representation {RepType : acctest .Optional , Create : `ACTIVE` },
4849 "filter" : acctest.RepresentationGroup {RepType : acctest .Required , Group : JmsJavaDownloadsJavaDownloadReportDataSourceFilterRepresentation }}
50+
4951 JmsJavaDownloadsJavaDownloadReportDataSourceFilterRepresentation = map [string ]interface {}{
5052 "name" : acctest.Representation {RepType : acctest .Required , Create : `id` },
5153 "values" : acctest.Representation {RepType : acctest .Required , Create : []string {`${oci_jms_java_downloads_java_download_report.test_java_download_report.id}` }},
@@ -54,12 +56,22 @@ var (
5456 JmsJavaDownloadsJavaDownloadReportRepresentation = map [string ]interface {}{
5557 "compartment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.tenancy_ocid}` },
5658 "format" : acctest.Representation {RepType : acctest .Required , Create : `CSV` },
57- "time_end" : acctest.Representation {RepType : acctest .Optional , Create : JmsJdReportTimeEnded },
58- "time_start" : acctest.Representation {RepType : acctest .Optional , Create : JmsJdReportTimeStarted },
59+ "defined_tags" : acctest.Representation {
60+ RepType : acctest .Optional ,
61+ Create : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}` ,
62+ Update : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}` },
63+ "freeform_tags" : acctest.Representation {
64+ RepType : acctest .Optional ,
65+ Create : map [string ]string {"bar-key" : "bar-value" },
66+ Update : map [string ]string {"bar-key" : "updatedValue" }},
67+ "time_end" : acctest.Representation {RepType : acctest .Optional , Create : JmsJdReportTimeEnded },
68+ "time_start" : acctest.Representation {RepType : acctest .Optional , Create : JmsJdReportTimeStarted },
5969 "lifecycle" : acctest.RepresentationGroup {
6070 RepType : acctest .Required ,
6171 Group : map [string ]interface {}{
62- "ignore_changes" : acctest.Representation {RepType : acctest .Required , Create : []string {`defined_tags` , `system_tags` }},
72+ "ignore_changes" : acctest.Representation {
73+ RepType : acctest .Required ,
74+ Create : []string {`defined_tags` , `system_tags` }},
6375 },
6476 },
6577 }
@@ -81,6 +93,7 @@ func TestJmsJavaDownloadsJavaDownloadReportResource_basic(t *testing.T) {
8193 var resId string
8294 // Save TF content to Create resource with optional properties. This has to be exactly the same as the config part in the "create with optionals" step in the test.
8395 acctest .SaveConfigContent (config +
96+ JmsJavaDownloadsJavaDownloadReportResourceDependencies +
8497 acctest .GenerateResourceFromRepresentationMap (
8598 "oci_jms_java_downloads_java_download_report" ,
8699 "test_java_download_report" ,
@@ -96,6 +109,7 @@ func TestJmsJavaDownloadsJavaDownloadReportResource_basic(t *testing.T) {
96109 // verify Create with optionals
97110 {
98111 Config : config +
112+ JmsJavaDownloadsJavaDownloadReportResourceDependencies +
99113 acctest .GenerateResourceFromRepresentationMap (
100114 "oci_jms_java_downloads_java_download_report" ,
101115 "test_java_download_report" ,
@@ -111,6 +125,9 @@ func TestJmsJavaDownloadsJavaDownloadReportResource_basic(t *testing.T) {
111125 resource .TestCheckResourceAttrSet (resourceName , "display_name" ),
112126 resource .TestCheckResourceAttrSet (resourceName , "file_size_in_bytes" ),
113127 resource .TestCheckResourceAttr (resourceName , "format" , "CSV" ),
128+ resource .TestCheckResourceAttrSet (resourceName , "sort_by" ),
129+ resource .TestCheckResourceAttrSet (resourceName , "sort_order" ),
130+ resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
114131 resource .TestCheckResourceAttrSet (resourceName , "id" ),
115132 resource .TestCheckResourceAttrSet (resourceName , "state" ),
116133 resource .TestCheckResourceAttrSet (resourceName , "time_created" ),
@@ -131,6 +148,7 @@ func TestJmsJavaDownloadsJavaDownloadReportResource_basic(t *testing.T) {
131148 // verify datasource
132149 {
133150 Config : config +
151+ JmsJavaDownloadsJavaDownloadReportResourceDependencies +
134152 acctest .GenerateDataSourceFromRepresentationMap (
135153 "oci_jms_java_downloads_java_download_reports" ,
136154 "test_java_download_reports" ,
@@ -156,6 +174,7 @@ func TestJmsJavaDownloadsJavaDownloadReportResource_basic(t *testing.T) {
156174 // verify singular datasource
157175 {
158176 Config : config +
177+ JmsJavaDownloadsJavaDownloadReportResourceDependencies +
159178 acctest .GenerateDataSourceFromRepresentationMap (
160179 "oci_jms_java_downloads_java_download_report" ,
161180 "test_java_download_report" ,
@@ -179,9 +198,14 @@ func TestJmsJavaDownloadsJavaDownloadReportResource_basic(t *testing.T) {
179198 resource .TestCheckResourceAttrSet (singularDatasourceName , "display_name" ),
180199 resource .TestCheckResourceAttrSet (singularDatasourceName , "file_size_in_bytes" ),
181200 resource .TestCheckResourceAttr (singularDatasourceName , "format" , "CSV" ),
201+ resource .TestCheckResourceAttrSet (resourceName , "sort_by" ),
202+ resource .TestCheckResourceAttrSet (resourceName , "sort_order" ),
203+ resource .TestCheckResourceAttr (singularDatasourceName , "freeform_tags.%" , "1" ),
182204 resource .TestCheckResourceAttrSet (singularDatasourceName , "id" ),
183205 resource .TestCheckResourceAttrSet (singularDatasourceName , "state" ),
184206 resource .TestCheckResourceAttrSet (singularDatasourceName , "time_created" ),
207+ resource .TestCheckResourceAttrSet (singularDatasourceName , "time_end" ),
208+ resource .TestCheckResourceAttrSet (singularDatasourceName , "time_start" ),
185209 ),
186210 },
187211 })
0 commit comments