@Test public void testStartDeploymentFailure() { //initialize and start the wizard. wizard.start(provider, pipelines); verifyStart(); //e.g. PIPELINE1 was selected. preSelectForms(PIPELINE1_KEY); //emulate the user completing the wizard. preCompleteWizard(PIPELINE1_KEY, RUNTIME); prepareServiceCallerError(runtimeService, runtimeServiceCaller); //emulates the user pressing the finish button wizard.complete(); //the parameters must the the values collected by the forms. Map<String, String> expectedPrams = buildExpectedParams(paramsFormsValues); expectedPrams.put(RUNTIME_NAME, RUNTIME); verify(runtimeService, times(1)).createRuntime(provider.getKey(), RUNTIME, PIPELINE1_KEY, expectedPrams); verify(defaultErrorCallback, times(1)).error(any(Message.class), any(Throwable.class)); verify(notification, never()).fire(any(NotificationEvent.class)); }
@Test public void testStartDeploymentFailure() { //initialize and start the wizard. wizard.start(provider, pipelines); verifyStart(); //e.g. PIPELINE1 was selected. preSelectForms(PIPELINE1_KEY); //emulate the user completing the wizard. preCompleteWizard(PIPELINE1_KEY, RUNTIME); prepareServiceCallerError(runtimeService, runtimeServiceCaller); //emulates the user pressing the finish button wizard.complete(); //the parameters must the the values collected by the forms. Map<String, String> expectedPrams = buildExpectedParams(paramsFormsValues); expectedPrams.put(RUNTIME_NAME, RUNTIME); verify(runtimeService, times(1)).createRuntime(provider.getKey(), RUNTIME, PIPELINE1_KEY, expectedPrams); verify(defaultErrorCallback, times(1)).error(any(Message.class), any(Throwable.class)); verify(notification, never()).fire(any(NotificationEvent.class)); }
@Test public void testStartDeploymentSuccess() { //initialize and start the wizard. wizard.start(provider, pipelines); verifyStart(); //e.g. PIPELINE1 was selected. preSelectForms(PIPELINE1_KEY); //emulate the user completing the wizard. preCompleteWizard(PIPELINE1_KEY, RUNTIME); //emulates the user pressing the finish button wizard.complete(); //the parameters must the the values collected by the forms. Map<String, String> expectedPrams = buildExpectedParams(paramsFormsValues); expectedPrams.put(RUNTIME_NAME, RUNTIME); verify(runtimeService, times(1)).createRuntime(provider.getKey(), RUNTIME, PIPELINE1_KEY, expectedPrams); verify(notification, times(1)).fire(new NotificationEvent(SUCCESS_MESSAGE, NotificationEvent.NotificationType.SUCCESS)); verify(refreshRuntimeEvent, times(1)).fire(new RefreshRuntimeEvent(provider.getKey())); }
@Test public void testStartDeploymentSuccess() { //initialize and start the wizard. wizard.start(provider, pipelines); verifyStart(); //e.g. PIPELINE1 was selected. preSelectForms(PIPELINE1_KEY); //emulate the user completing the wizard. preCompleteWizard(PIPELINE1_KEY, RUNTIME); //emulates the user pressing the finish button wizard.complete(); //the parameters must the the values collected by the forms. Map<String, String> expectedPrams = buildExpectedParams(paramsFormsValues); expectedPrams.put(RUNTIME_NAME, RUNTIME); verify(runtimeService, times(1)).createRuntime(provider.getKey(), RUNTIME, PIPELINE1_KEY, expectedPrams); verify(notification, times(1)).fire(new NotificationEvent(SUCCESS_MESSAGE, NotificationEvent.NotificationType.SUCCESS)); verify(refreshRuntimeEvent, times(1)).fire(new RefreshRuntimeEvent(provider.getKey())); }