@Test public void testBuildParams() { when(view.getRuntimeName()).thenReturn(RUNTIME_NAME); when(view.getOU()).thenReturn(OU); when(view.getRepository()).thenReturn(REPOSITORY); when(view.getBranch()).thenReturn(BRANCH); when(sourceService.getModules(eq(SPACE), eq(REPOSITORY), eq(BRANCH))).thenReturn(modules); when(view.getModule()).thenReturn(MODULE); presenter.onBranchChange(); int selectedModule = 2; String moduleName = modules.get(selectedModule).getModuleName(); when(view.getModule()).thenReturn(moduleName); Map<String, String> params = presenter.buildParams(); assertEquals(RUNTIME_NAME, params.get(NewDeployWizard.RUNTIME_NAME)); assertEquals(OU + "/" + REPOSITORY, params.get(SourceConfigurationParamsPresenter.REPO_NAME)); assertEquals(BRANCH, params.get(SourceConfigurationParamsPresenter.BRANCH)); assertEquals(moduleName, params.get(SourceConfigurationParamsPresenter.MODULE_DIR)); }
@Override public Map<String, String> buildParams() { Map<String, String> params = new HashMap<>(); params.put(RUNTIME_NAME, getRuntime()); params.put(REPO_NAME, getSpace().getName() + "/" + getRepository()); params.put(BRANCH, getBranch()); params.put(MODULE_DIR, getModule().getModuleName()); return params; }
SourceConfigurationParamsPresenter extends AbstractHasContentChangeHandlers implements PipelineParamsForm { @Override public Map<String, String> buildParams() { Map<String, String> params = new HashMap<>(); params.put(RUNTIME_NAME, getRuntime()); params.put(REPO_NAME, getSpace().getName() + "/" + getRepository()); params.put(BRANCH, getBranch()); params.put(MODULE_DIR, getModule().getModuleName()); return params; } }
SourceConfigurationParamsPresenter extends AbstractHasContentChangeHandlers implements PipelineParamsForm { @Override public Map<String, String> buildParams() { Map<String, String> params = new HashMap<>(); params.put(RUNTIME_NAME, getRuntime()); params.put(REPO_NAME, getSpace().getName() + "/" + getRepository()); params.put(BRANCH, getBranch()); params.put(MODULE_DIR, getModule().getModuleName()); return params; } @Inject  SourceConfigurationParamsPresenter(final View view,
                                              final Caller<SourceService> sourceService); }
SourceConfigurationParamsPresenter extends AbstractHasContentChangeHandlers implements PipelineParamsForm { @Override public Map<String, String> buildParams() { Map<String, String> params = new HashMap<>(); params.put(RUNTIME_NAME, getRuntime()); params.put(REPO_NAME, getSpace().getName() + "/" + getRepository()); params.put(BRANCH, getBranch()); params.put(MODULE_DIR, getModule().getModuleName()); return params; } @Inject  SourceConfigurationParamsPresenter(final View view,
                                              final Caller<SourceService> sourceService); @PostConstruct void init(); @Override IsElement getView(); @Override String getWizardTitle(); @Override void isComplete(final Callback<Boolean> callback); @Override void initialise(); @Override void prepareView(); @Override Map<String, String> buildParams(); @Override void clear(); void disable(); }
SourceConfigurationParamsPresenter extends AbstractHasContentChangeHandlers implements PipelineParamsForm { @Override public Map<String, String> buildParams() { Map<String, String> params = new HashMap<>(); params.put(RUNTIME_NAME, getRuntime()); params.put(REPO_NAME, getSpace().getName() + "/" + getRepository()); params.put(BRANCH, getBranch()); params.put(MODULE_DIR, getModule().getModuleName()); return params; } @Inject  SourceConfigurationParamsPresenter(final View view,
                                              final Caller<SourceService> sourceService); @PostConstruct void init(); @Override IsElement getView(); @Override String getWizardTitle(); @Override void isComplete(final Callback<Boolean> callback); @Override void initialise(); @Override void prepareView(); @Override Map<String, String> buildParams(); @Override void clear(); void disable(); static final String REPO_NAME; static final String BRANCH; static final String MODULE_DIR; }