### Question:
AutoScalingGroupHandler { public void updateAutoScalingGroupWithLaunchConfiguration(AmazonAutoScalingClient autoScalingClient, String autoScalingGroupName, LaunchConfiguration oldLaunchConfiguration, String launchConfigurationName) { UpdateAutoScalingGroupRequest updateAutoScalingGroupRequest = new UpdateAutoScalingGroupRequest(); updateAutoScalingGroupRequest.setAutoScalingGroupName(autoScalingGroupName); updateAutoScalingGroupRequest.setLaunchConfigurationName(launchConfigurationName); LOGGER.debug("Update AutoScalingGroup {} with LaunchConfiguration {}", updateAutoScalingGroupRequest.getAutoScalingGroupName(), updateAutoScalingGroupRequest.getLaunchConfigurationName()); autoScalingClient.updateAutoScalingGroup(updateAutoScalingGroupRequest); }  void updateAutoScalingGroupWithLaunchConfiguration(AmazonAutoScalingClient autoScalingClient, String autoScalingGroupName,
            LaunchConfiguration oldLaunchConfiguration, String launchConfigurationName); Map<AutoScalingGroup, String> getAutoScalingGroups(AmazonCloudFormationClient cloudFormationClient, AmazonAutoScalingClient autoScalingClient,
            CloudResource cfResource);  }### Answer:
@Test public void testUpdateAutoScalingGroupWithLaunchConfiguration() { String autoScalingGroupName = "autoScalingGroupName"; String launchConfigurationName = "launchConfigurationName"; LaunchConfiguration oldLaunchConfiguration = new LaunchConfiguration(); underTest.updateAutoScalingGroupWithLaunchConfiguration(autoScalingClient, autoScalingGroupName, oldLaunchConfiguration, launchConfigurationName); ArgumentCaptor<UpdateAutoScalingGroupRequest> captor = ArgumentCaptor.forClass(UpdateAutoScalingGroupRequest.class); verify(autoScalingClient, times(1)).updateAutoScalingGroup(captor.capture()); UpdateAutoScalingGroupRequest request = captor.getValue(); assertNotNull(request); assertEquals(autoScalingGroupName, request.getAutoScalingGroupName()); assertEquals(launchConfigurationName, request.getLaunchConfigurationName()); }