@@ -438,17 +438,24 @@ func TestCreateLogGroupsTwoContainers(t *testing.T) {
438
438
assert .NoError (t , err , "Unexpected error in call to CreateLogGroups()" )
439
439
}
440
440
441
- func TestCreateLogGroupsWrongDriver (t * testing.T ) {
441
+ func TestCreateLogGroupsOneContainerWrongDriver (t * testing.T ) {
442
442
taskDef := dummyTaskDef ([]* ecs.ContainerDefinition {
443
- dummyContainerDef (logRegion1 , logGroup1 , logPrefix1 , "catsanddogslogger" , containerName , containerImage ),
443
+ dummyContainerDef (logRegion1 , logGroup1 , logPrefix1 , "awslogs" , containerName , containerImage ),
444
+ dummyContainerDef (logRegion2 , logGroup2 , logPrefix1 , "catsanddogslogger" , containerName , containerImage ),
444
445
})
445
446
446
447
ctrl := gomock .NewController (t )
447
448
defer ctrl .Finish ()
448
449
mockLogFactory := mock_cloudwatchlogs .NewMockLogClientFactory (ctrl )
450
+ mockLogClient := mock_cloudwatchlogs .NewMockClient (ctrl )
451
+
452
+ gomock .InOrder (
453
+ mockLogFactory .EXPECT ().Get (logRegion1 ).Return (mockLogClient ),
454
+ mockLogClient .EXPECT ().CreateLogGroup (gomock .Any ()),
455
+ )
449
456
450
457
err := CreateLogGroups (taskDef , mockLogFactory )
451
- assert .Error (t , err , "Expected error in call to CreateLogGroups()" )
458
+ assert .NoError (t , err , "Unexpected error in call to CreateLogGroups()" )
452
459
}
453
460
454
461
func TestCreateLogGroupsLogGroupAlreadyExists (t * testing.T ) {
0 commit comments