public void testDisplay() throws Exception { Window uispecDialog = createUISpecWindow(JOB_WITH_GOOD_PARAMS); assertEquals("This build requires parameters", uispecDialog.getTitle()); assertTrue(uispecDialog.getCheckBox("integrationTest").isSelected()); ComboBox envCombo = uispecDialog.getComboBox("environment"); assertTrue(envCombo.contains("development", "integration", "acceptance", "production")); assertTrue(envCombo.selectionEquals("development")); assertTrue(StringUtils.isEmpty(uispecDialog.findSwingComponent(JTextField.class).getText())); assertTrue(uispecDialog.getButton("OK").isEnabled()); }
public void testLaunchBuild() throws Exception { Window uispecDialog = createUISpecWindow(JOB_WITH_GOOD_PARAMS); uispecDialog.getCheckBox("integrationTest").unselect(); uispecDialog.getComboBox("environment").select("acceptance"); uispecDialog.getButton("OK").click(); ArgumentCaptor<Map> paramMap = ArgumentCaptor.forClass(Map.class); verify(requestManager, times(1)) .runParameterizedBuild(any(Job.class), any(JenkinsConfiguration.class), paramMap.capture()); Map expectedParamMapValue = paramMap.getValue(); assertEquals(3, expectedParamMapValue.size()); assertEquals("false", expectedParamMapValue.get("integrationTest")); assertEquals("acceptance", expectedParamMapValue.get("environment")); assertEquals("", expectedParamMapValue.get("message")); }