Yum { public GenericYumCommand upgrade(YumPackageName... packages) { return new GenericYumCommand(terminal, "upgrade", List.of(packages), UPGRADE_NOOP_PATTERN); } Yum(Terminal terminal); Optional<YumPackageName> queryInstalled(TaskContext context, String packageName); InstallFixedYumCommand installFixedVersion(YumPackageName yumPackage); GenericYumCommand install(YumPackageName... packages); GenericYumCommand install(String package1, String... packages); GenericYumCommand install(List<String> packages); GenericYumCommand upgrade(YumPackageName... packages); GenericYumCommand upgrade(String package1, String... packages); GenericYumCommand upgrade(List<String> packages); GenericYumCommand remove(YumPackageName... packages); GenericYumCommand remove(String package1, String... packages); GenericYumCommand remove(List<String> packages);  }
@Test public void testAlreadyUpgraded() { terminal.expectCommand( "yum upgrade --assumeyes --setopt skip_missing_names_on_update=False package-1 package-2 2>&1", 0, "foobar\nNo packages marked for update\n"); assertFalse(yum .upgrade("package-1", "package-2") .converge(taskContext)); }
@Test public void allowToCallUpgradeWithNoPackages() { terminal.expectCommand("yum upgrade --assumeyes 2>&1", 0, "OK"); yum.upgrade().converge(taskContext); }