@@ -16,22 +16,22 @@ import (
1616func TestResult_String_TextFormat (t * testing.T ) {
1717 result := & Result {
1818 StackName : "test-stack" ,
19- Environment : "dev" ,
19+ Context : "dev" ,
2020 StackExists : true ,
2121 Options : Options {Format : "text" },
2222 }
2323
2424 output := result .String ()
2525
26- assert .Contains (t , output , "Stack: test-stack (Environment : dev)" )
26+ assert .Contains (t , output , "Stack: test-stack (Context : dev)" )
2727 assert .Contains (t , output , "Status: NO CHANGES" )
2828 assert .Contains (t , output , "The deployed stack matches your local configuration." )
2929}
3030
3131func TestResult_String_JSONFormat (t * testing.T ) {
3232 result := & Result {
3333 StackName : "test-stack" ,
34- Environment : "dev" ,
34+ Context : "dev" ,
3535 StackExists : true ,
3636 Options : Options {Format : "json" },
3737 }
@@ -43,16 +43,15 @@ func TestResult_String_JSONFormat(t *testing.T) {
4343 err := json .Unmarshal ([]byte (output ), & jsonData )
4444 require .NoError (t , err )
4545
46- assert .Equal (t , "test-stack" , jsonData ["stackName" ])
47- assert .Equal (t , "dev" , jsonData ["environment" ])
46+ assert .Equal (t , "dev" , jsonData ["context" ])
4847 assert .Equal (t , true , jsonData ["stackExists" ])
4948 assert .Equal (t , false , jsonData ["hasChanges" ])
5049}
5150
5251func TestResult_ToText_NewStack (t * testing.T ) {
5352 result := & Result {
5453 StackName : "new-stack" ,
55- Environment : "prod" ,
54+ Context : "prod" ,
5655 StackExists : false ,
5756 ParameterDiffs : []ParameterDiff {
5857 {Key : "InstanceType" , ProposedValue : "t3.micro" , ChangeType : ChangeTypeAdd },
@@ -62,12 +61,11 @@ func TestResult_ToText_NewStack(t *testing.T) {
6261 {Key : "Owner" , ProposedValue : "team-a" , ChangeType : ChangeTypeAdd },
6362 {Key : "Project" , ProposedValue : "webapp" , ChangeType : ChangeTypeAdd },
6463 },
65- Options : Options {Format : "text" },
6664 }
6765
6866 output := result .toText ()
6967
70- assert .Contains (t , output , "Stack: new-stack (Environment : prod)" )
68+ assert .Contains (t , output , "Stack: new-stack (Context : prod)" )
7169 assert .Contains (t , output , "Status: NEW STACK" )
7270 assert .Contains (t , output , "This stack does not exist in AWS and will be created." )
7371 assert .Contains (t , output , "Parameters to be set:" )
@@ -81,7 +79,7 @@ func TestResult_ToText_NewStack(t *testing.T) {
8179func TestResult_ToText_WithChanges (t * testing.T ) {
8280 result := & Result {
8381 StackName : "existing-stack" ,
84- Environment : "dev" ,
82+ Context : "dev" ,
8583 StackExists : true ,
8684 TemplateChange : & TemplateChange {
8785 HasChanges : true ,
@@ -122,7 +120,7 @@ func TestResult_ToText_WithChanges(t *testing.T) {
122120 output := result .toText ()
123121
124122 // Header checks
125- assert .Contains (t , output , "Stack: existing-stack (Environment : dev)" )
123+ assert .Contains (t , output , "Stack: existing-stack (Context : dev)" )
126124 assert .Contains (t , output , "Status: CHANGES DETECTED" )
127125
128126 // Template changes
@@ -183,7 +181,7 @@ func TestResult_ToText_FilteredOptions(t *testing.T) {
183181 t .Run (tt .name , func (t * testing.T ) {
184182 result := & Result {
185183 StackName : "test-stack" ,
186- Environment : "dev" ,
184+ Context : "dev" ,
187185 StackExists : true ,
188186 TemplateChange : & TemplateChange {HasChanges : true , Diff : "template changes" },
189187 ParameterDiffs : []ParameterDiff {{Key : "test" , ChangeType : ChangeTypeAdd }},
@@ -206,7 +204,7 @@ func TestResult_ToText_FilteredOptions(t *testing.T) {
206204func TestResult_ToJSON_Complete (t * testing.T ) {
207205 result := & Result {
208206 StackName : "test-stack" ,
209- Environment : "prod" ,
207+ Context : "prod" ,
210208 StackExists : true ,
211209 TemplateChange : & TemplateChange {
212210 HasChanges : true ,
@@ -241,7 +239,7 @@ func TestResult_ToJSON_Complete(t *testing.T) {
241239
242240 // Check top-level fields
243241 assert .Equal (t , "test-stack" , data ["stackName" ])
244- assert .Equal (t , "prod" , data ["environment " ])
242+ assert .Equal (t , "prod" , data ["context " ])
245243 assert .Equal (t , true , data ["stackExists" ])
246244 assert .Equal (t , true , data ["hasChanges" ])
247245
@@ -290,7 +288,7 @@ func TestResult_ToJSON_Complete(t *testing.T) {
290288func TestResult_ToJSON_MinimalData (t * testing.T ) {
291289 result := & Result {
292290 StackName : "minimal-stack" ,
293- Environment : "test" ,
291+ Context : "test" ,
294292 StackExists : false ,
295293 Options : Options {Format : "json" },
296294 }
@@ -302,7 +300,7 @@ func TestResult_ToJSON_MinimalData(t *testing.T) {
302300 require .NoError (t , err )
303301
304302 assert .Equal (t , "minimal-stack" , data ["stackName" ])
305- assert .Equal (t , "test" , data ["environment " ])
303+ assert .Equal (t , "test" , data ["context " ])
306304 assert .Equal (t , false , data ["stackExists" ])
307305 assert .Equal (t , true , data ["hasChanges" ]) // New stack (StackExists: false) always has changes
308306
@@ -318,7 +316,7 @@ func TestResult_ToJSON_InvalidJSON(t *testing.T) {
318316 // We can't easily force json.Marshal to fail in Go, so we test the structure is correct
319317 result := & Result {
320318 StackName : "test-stack" ,
321- Environment : "dev" ,
319+ Context : "dev" ,
322320 StackExists : true ,
323321 Options : Options {Format : "json" },
324322 }
@@ -330,7 +328,7 @@ func TestResult_ToJSON_InvalidJSON(t *testing.T) {
330328
331329 // Should be properly formatted
332330 assert .Contains (t , jsonOutput , `"stackName": "test-stack"` )
333- assert .Contains (t , jsonOutput , `"environment ": "dev"` )
331+ assert .Contains (t , jsonOutput , `"context ": "dev"` )
334332}
335333
336334func TestResult_FormatNewStackText (t * testing.T ) {
0 commit comments