DeployTargetContext implements JDOMExternalizable { @NotNull public List<DeployTargetProvider> getApplicableDeployTargetProviders(boolean testConfiguration) { return myDeployTargetProviders.stream() .filter(provider -> provider.isApplicable(testConfiguration)) .collect(Collectors.toList()); } DeployTargetContext(); @VisibleForTesting  DeployTargetContext(@NotNull Collection<DeployTargetProvider> deployTargetProviders); @NotNull List<DeployTargetProvider> getApplicableDeployTargetProviders(boolean testConfiguration); @NotNull DeployTargetProvider getCurrentDeployTargetProvider(); @NotNull Map<String, DeployTargetState> getDeployTargetStates(); @NotNull DeployTargetState getCurrentDeployTargetState(); @NotNull DeployTargetState getDeployTargetState(@NotNull DeployTargetProvider target); void setTargetSelectionMode(@NotNull TargetSelectionMode mode); void setTargetSelectionMode(@NotNull DeployTargetProvider target); @NotNull TargetSelectionMode getTargetSelectionMode(); @Override void readExternal(Element element); @Override void writeExternal(Element element); public String TARGET_SELECTION_MODE; }
@Test public void getApplicableDeployTargetProvidersVisibleComboBoxAppConfiguration() { Object actualProviders = myContext.getApplicableDeployTargetProviders(false); assertEquals(Collections.singletonList(myDeviceAndSnapshotComboBoxTargetProvider), actualProviders); }
@Test public void getApplicableDeployTargetProvidersVisibleComboBoxTestConfiguration() { Object actualProviders = myContext.getApplicableDeployTargetProviders(true); assertEquals(Arrays.asList(myDeviceAndSnapshotComboBoxTargetProvider, myCloudTestMatrixTargetProvider), actualProviders); }