InfraDeployerImpl implements InfraDeployer { @Override public Optional<Deployment> getDeployment(ApplicationId application) { return duperModel.getInfraApplication(application).map(InfraDeployment::new); } @Inject  InfraDeployerImpl(NodeRepository nodeRepository, Provisioner provisioner, DuperModelInfraApi duperModel); @Override Optional<Deployment> getDeployment(ApplicationId application); @Override void activateAllSupportedInfraApplications(boolean propagateException);  }
@Test public void activate() { infrastructureVersions.setTargetVersion(nodeType, target, false); addNode(1, Node.State.failed, Optional.of(oldVersion)); addNode(2, Node.State.parked, Optional.of(target)); addNode(3, Node.State.active, Optional.of(target)); addNode(4, Node.State.inactive, Optional.of(target)); addNode(5, Node.State.dirty, Optional.empty()); addNode(6, Node.State.ready, Optional.empty()); Node node7 = addNode(7, Node.State.active, Optional.of(target)); nodeRepository.setRemovable(application.getApplicationId(), List.of(node7)); infraDeployer.getDeployment(application.getApplicationId()).orElseThrow().activate(); verify(duperModelInfraApi, never()).infraApplicationRemoved(any()); verifyActivated("node-3", "node-6"); }