|
1 | 1 | package unit
|
2 | 2 |
|
3 | 3 | import (
|
4 |
| - "encoding/json" |
5 |
| - "strings" |
6 | 4 | "testing"
|
7 |
| - |
8 |
| - "github.com/gruntwork-io/terratest/modules/random" |
9 | 5 | tests "github.com/microsoft/cobalt/infra/modules/providers/azure/data-factory/tests"
|
10 | 6 | "github.com/microsoft/terratest-abstraction/unit"
|
11 | 7 | )
|
12 | 8 |
|
13 |
| -// helper function to parse blocks of JSON into a generic Go map |
14 |
| -func asMap(t *testing.T, jsonString string) map[string]interface{} { |
15 |
| - var theMap map[string]interface{} |
16 |
| - if err := json.Unmarshal([]byte(jsonString), &theMap); err != nil { |
17 |
| - t.Fatal(err) |
18 |
| - } |
19 |
| - return theMap |
20 |
| -} |
21 |
| - |
22 | 9 | func TestTemplate(t *testing.T) {
|
23 | 10 |
|
24 | 11 | expectedDataFactory := map[string]interface{}{
|
@@ -53,27 +40,16 @@ func TestTemplate(t *testing.T) {
|
53 | 40 | "frequency": "Minute",
|
54 | 41 | }
|
55 | 42 |
|
56 |
| - expectedDatasetSQL := map[string]interface{}{ |
57 |
| - "name": "testsql", |
58 |
| - } |
59 |
| - |
60 |
| - expectedLinkedSQL := map[string]interface{}{ |
61 |
| - "name": "testlinkedsql", |
62 |
| - "connection_string": "connectionstring", |
63 |
| - } |
64 |
| - |
65 | 43 | testFixture := unit.UnitTestFixture{
|
66 | 44 | GoTest: t,
|
67 | 45 | TfOptions: tests.DataFactoryTFOptions,
|
68 | 46 | PlanAssertions: nil,
|
69 |
| - ExpectedResourceCount: 6, |
| 47 | + ExpectedResourceCount: 4, |
70 | 48 | ExpectedResourceAttributeValues: unit.ResourceDescription{
|
71 | 49 | "azurerm_data_factory.main": expectedDataFactory,
|
72 | 50 | "azurerm_data_factory_integration_runtime_managed.main": expectedDFIntRunTime,
|
73 | 51 | "azurerm_data_factory_pipeline.main": expectedPipeline,
|
74 | 52 | "azurerm_data_factory_trigger_schedule.main": expectedTrigger,
|
75 |
| - "azurerm_data_factory_dataset_sql_server_table.main": expectedDatasetSQL, |
76 |
| - "azurerm_data_factory_linked_service_sql_server.main": expectedLinkedSQL, |
77 | 53 | },
|
78 | 54 | }
|
79 | 55 |
|
|
0 commit comments