@@ -18,22 +18,39 @@ func TestAccKongSni(t *testing.T) {
1818 Config : testCreateSniConfig ,
1919 Check : resource .ComposeTestCheckFunc (
2020 testAccCheckKongSniExists ("kong_sni.sni" ),
21- //testAccCheckForChildIdCorrect("kong_certificate.certificate1", "kong_sni.sni", "certificate_id"),
2221 resource .TestCheckResourceAttr ("kong_sni.sni" , "name" , "www.example.com" ),
2322 ),
2423 },
2524 {
2625 Config : testUpdateSniConfig ,
2726 Check : resource .ComposeTestCheckFunc (
2827 testAccCheckKongSniExists ("kong_sni.sni" ),
29- //testAccCheckForChildIdCorrect("kong_certificate.certificate2", "kong_sni.sni", "certificate_id"),
3028 resource .TestCheckResourceAttr ("kong_sni.sni" , "name" , "www.example.com" ),
3129 ),
3230 },
3331 },
3432 })
3533}
3634
35+ func TestAccKongSniImport (t * testing.T ) {
36+
37+ resource .Test (t , resource.TestCase {
38+ Providers : testAccProviders ,
39+ CheckDestroy : testAccCheckKongSniDestroy ,
40+ Steps : []resource.TestStep {
41+ resource.TestStep {
42+ Config : testCreateSniConfig ,
43+ },
44+
45+ resource.TestStep {
46+ ResourceName : "kong_sni.sni" ,
47+ ImportState : true ,
48+ ImportStateVerify : true ,
49+ },
50+ },
51+ })
52+ }
53+
3754func testAccCheckKongSniDestroy (state * terraform.State ) error {
3855
3956 client := testAccProvider .Meta ().(* gokong.KongAdminClient )
0 commit comments