-
Task
-
Resolution: Unresolved
-
Major
In order to properly test if it is executed on a slave, it requires end-to-end tests (using JenkinsRule).
The tests should as well integrate this tests back:
@Test public void ifCheckedPerformOsCheck_shouldThrowException_withCorrectValue() throws Exception { initializeOperatingSystemOs("windows"); try { healthAnalyzerCommon.ifCheckedPerformOsCheck(OperatingSystem.LINUX, true); fail(); } catch (AbortException e) { assertEquals(e.getMessage(), String.format("Your operating system: %s is not %s.", "linux", OperatingSystem.getOs())); } } @Test public void ifCheckedPerformOsCheck_doesNotThrowException() throws Exception { initializeOperatingSystemOs("windows"); healthAnalyzerCommon.ifCheckedPerformOsCheck(OperatingSystem.WINDOWS, true); } @Test public void isCheckedPerformWindowsInstallationCheck_throwsCorrectExceptionValue() throws Exception { if (OperatingSystem.IS_WINDOWS) { try { healthAnalyzerCommon.isRegistryExist(NON_EXISTING_REGISTRY); fail(); } catch (AbortException e) { assertEquals(e.getMessage(), DUMMY_PRODUCT_NAME + " is not installed. Please install it first."); } } }