### Question:
AAICreateTasks { protected void createPlatformNetwork(L3Network network) { Platform platform = network.getPlatform(); if (platform != null) { if (Strings.isNullOrEmpty(platform.getPlatformName())) { logger.debug("PlatformName is null in input. Skipping create platform..."); } else { List<String> platforms = splitCDL(platform.getPlatformName()); platforms.stream().forEach(platformName -> aaiNetworkResources .createPlatformAndConnectNetwork(new Platform(platformName), network)); } } }  void createServiceInstance(BuildingBlockExecution execution); void createServiceSubscription(BuildingBlockExecution execution); void createProject(BuildingBlockExecution execution); void createOwningEntity(BuildingBlockExecution execution); void createVnf(BuildingBlockExecution execution); void createPnf(BuildingBlockExecution execution); void createPlatformForNetwork(BuildingBlockExecution execution); void createPlatform(BuildingBlockExecution execution); List<String> splitCDL(String str); void createLineOfBusiness(BuildingBlockExecution execution); void createLineOfBusinessForNetwork(BuildingBlockExecution execution); void createVolumeGroup(BuildingBlockExecution execution); void createVfModule(BuildingBlockExecution execution); void connectVfModuleToVolumeGroup(BuildingBlockExecution execution); void createNetwork(BuildingBlockExecution execution); void createCustomer(BuildingBlockExecution execution); void createNetworkCollection(BuildingBlockExecution execution); void createNetworkCollectionInstanceGroup(BuildingBlockExecution execution); void connectNetworkToTenant(BuildingBlockExecution execution); void connectNetworkToCloudRegion(BuildingBlockExecution execution); void connectVnfToCloudRegion(BuildingBlockExecution execution); void connectVnfToTenant(BuildingBlockExecution execution); void connectNetworkToNetworkCollectionServiceInstance(BuildingBlockExecution execution); void connectNetworkToNetworkCollectionInstanceGroup(BuildingBlockExecution execution); void createConfiguration(BuildingBlockExecution execution); void createInstanceGroupVnf(BuildingBlockExecution execution); void createNetworkPolicies(BuildingBlockExecution execution);  }### Answer:
@Test public void createPlatformNetworkTest() throws Exception { doNothing().when(aaiNetworkResources).createPlatformAndConnectNetwork(network.getPlatform(), network); aaiCreateTasks.createPlatformForNetwork(execution); ArgumentCaptor<Platform> platformCaptor = ArgumentCaptor.forClass(Platform.class); ArgumentCaptor<L3Network> network = ArgumentCaptor.forClass(L3Network.class); Mockito.verify(aaiNetworkResources, times(4)).createPlatformAndConnectNetwork(platformCaptor.capture(), network.capture()); List<Platform> capturedPlatforms = platformCaptor.getAllValues(); String actual = capturedPlatforms.stream().map(item -> item.getPlatformName()).collect(Collectors.toList()) .stream().sorted().collect(Collectors.joining(" ,")); String expected = Arrays.asList("testPlatformName", "testPlatformName2", "testPlatformName3", "testPlatformName4") .stream().sorted().collect(Collectors.joining(" ,")); assertEquals(expected, actual); assertTrue(capturedPlatforms.stream().anyMatch(item -> "testPlatformName".equals(item.getPlatformName()))); assertTrue(capturedPlatforms.stream().anyMatch(item -> "testPlatformName2".equals(item.getPlatformName()))); assertTrue(capturedPlatforms.stream().anyMatch(item -> "testPlatformName3".equals(item.getPlatformName()))); assertTrue(capturedPlatforms.stream().anyMatch(item -> "testPlatformName4".equals(item.getPlatformName()))); }