### Question:
PluginConfigurationProcessor { @VisibleForTesting static Set<Platform> getPlatformsSet(RawConfiguration rawConfiguration) throws InvalidPlatformException { Set<Platform> platforms = new LinkedHashSet<>(); for (PlatformConfiguration platformConfiguration : rawConfiguration.getPlatforms()) { String platformToString = "architecture=" + platformConfiguration.getArchitectureName().orElse("<missing>") + ", os=" + platformConfiguration.getOsName().orElse("<missing>"); if (!platformConfiguration.getArchitectureName().isPresent()) { throw new InvalidPlatformException( "platform configuration is missing an architecture value", platformToString); } if (!platformConfiguration.getOsName().isPresent()) { throw new InvalidPlatformException( "platform configuration is missing an OS value", platformToString); } platforms.add( new Platform( platformConfiguration.getArchitectureName().get(), platformConfiguration.getOsName().get())); } return platforms; }  static JibBuildRunner createJibBuildRunnerForDockerDaemonImage(
      RawConfiguration rawConfiguration,
      InferredAuthProvider inferredAuthProvider,
      ProjectProperties projectProperties,
      HelpfulSuggestions helpfulSuggestions); static JibBuildRunner createJibBuildRunnerForTarImage(
      RawConfiguration rawConfiguration,
      InferredAuthProvider inferredAuthProvider,
      ProjectProperties projectProperties,
      HelpfulSuggestions helpfulSuggestions); static JibBuildRunner createJibBuildRunnerForRegistryImage(
      RawConfiguration rawConfiguration,
      InferredAuthProvider inferredAuthProvider,
      ProjectProperties projectProperties,
      HelpfulSuggestions helpfulSuggestions); static String getSkaffoldSyncMap(
      RawConfiguration rawConfiguration, ProjectProperties projectProperties, Set<Path> excludes);  }### Answer:
@Test public void testGetPlatformsSet() throws InvalidPlatformException { Mockito.<List<?>>when(rawConfiguration.getPlatforms()) .thenReturn(Arrays.asList(new TestPlatformConfiguration("testArchitecture", "testOs"))); Assert.assertEquals( ImmutableSet.of(new Platform("testArchitecture", "testOs")), PluginConfigurationProcessor.getPlatformsSet(rawConfiguration)); }
@Test public void testGetPlatformsSet_architectureMissing() { TestPlatformConfiguration platform = new TestPlatformConfiguration(null, "testOs"); Mockito.<List<?>>when(rawConfiguration.getPlatforms()).thenReturn(Arrays.asList(platform)); try { PluginConfigurationProcessor.getPlatformsSet(rawConfiguration); Assert.fail(); } catch (InvalidPlatformException ex) { Assert.assertEquals( "platform configuration is missing an architecture value", ex.getMessage()); Assert.assertEquals("architecture=<missing>, os=testOs", ex.getInvalidPlatform()); } }
@Test public void testGetPlatformsSet_osMissing() { TestPlatformConfiguration platform = new TestPlatformConfiguration("testArchitecture", null); Mockito.<List<?>>when(rawConfiguration.getPlatforms()).thenReturn(Arrays.asList(platform)); try { PluginConfigurationProcessor.getPlatformsSet(rawConfiguration); Assert.fail(); } catch (InvalidPlatformException ex) { Assert.assertEquals("platform configuration is missing an OS value", ex.getMessage()); Assert.assertEquals("architecture=testArchitecture, os=<missing>", ex.getInvalidPlatform()); } }