@Test public void addWhenInvalidVersionIdTest() { doReturn(GROUP_ID).when(view).getArchetypeGroupId(); doReturn(ARTIFACT_ID).when(view).getArchetypeArtifactId(); doReturn(null).when(view).getArchetypeVersion(); presenter.add(); verify(view).clearErrors(); verify(view).showArchetypeVersionError(anyString()); verify(archetypeService, never()).add(any(GAV.class)); }
public void add() { final String archetypeGroupId = view.getArchetypeGroupId(); final String archetypeArtifactId = view.getArchetypeArtifactId(); final String archetypeVersion = view.getArchetypeVersion(); validateFields(archetypeGroupId, archetypeArtifactId, archetypeVersion, () -> { beginAddArchetype(); final GAV archetypeGAV = new GAV(archetypeGroupId.trim(), archetypeArtifactId.trim(), archetypeVersion.trim()); archetypeService.call(v -> { endAddArchetype(); hide(); }, addActionErrorCallback()).add(archetypeGAV); }); }
AddArchetypeModalPresenter implements HasBusyIndicator { public void add() { final String archetypeGroupId = view.getArchetypeGroupId(); final String archetypeArtifactId = view.getArchetypeArtifactId(); final String archetypeVersion = view.getArchetypeVersion(); validateFields(archetypeGroupId, archetypeArtifactId, archetypeVersion, () -> { beginAddArchetype(); final GAV archetypeGAV = new GAV(archetypeGroupId.trim(), archetypeArtifactId.trim(), archetypeVersion.trim()); archetypeService.call(v -> { endAddArchetype(); hide(); }, addActionErrorCallback()).add(archetypeGAV); }); } }
AddArchetypeModalPresenter implements HasBusyIndicator { public void add() { final String archetypeGroupId = view.getArchetypeGroupId(); final String archetypeArtifactId = view.getArchetypeArtifactId(); final String archetypeVersion = view.getArchetypeVersion(); validateFields(archetypeGroupId, archetypeArtifactId, archetypeVersion, () -> { beginAddArchetype(); final GAV archetypeGAV = new GAV(archetypeGroupId.trim(), archetypeArtifactId.trim(), archetypeVersion.trim()); archetypeService.call(v -> { endAddArchetype(); hide(); }, addActionErrorCallback()).add(archetypeGAV); }); } @Inject  AddArchetypeModalPresenter(final View view,
                                      final TranslationService ts,
                                      final Caller<ArchetypeService> archetypeService,
                                      final BusyIndicatorView busyIndicatorView); }
AddArchetypeModalPresenter implements HasBusyIndicator { public void add() { final String archetypeGroupId = view.getArchetypeGroupId(); final String archetypeArtifactId = view.getArchetypeArtifactId(); final String archetypeVersion = view.getArchetypeVersion(); validateFields(archetypeGroupId, archetypeArtifactId, archetypeVersion, () -> { beginAddArchetype(); final GAV archetypeGAV = new GAV(archetypeGroupId.trim(), archetypeArtifactId.trim(), archetypeVersion.trim()); archetypeService.call(v -> { endAddArchetype(); hide(); }, addActionErrorCallback()).add(archetypeGAV); }); } @Inject  AddArchetypeModalPresenter(final View view,
                                      final TranslationService ts,
                                      final Caller<ArchetypeService> archetypeService,
                                      final BusyIndicatorView busyIndicatorView); @PostConstruct void postConstruct(); void show(); void hide(); void add(); void cancel(); @Override void showBusyIndicator(final String message); @Override void hideBusyIndicator(); }
AddArchetypeModalPresenter implements HasBusyIndicator { public void add() { final String archetypeGroupId = view.getArchetypeGroupId(); final String archetypeArtifactId = view.getArchetypeArtifactId(); final String archetypeVersion = view.getArchetypeVersion(); validateFields(archetypeGroupId, archetypeArtifactId, archetypeVersion, () -> { beginAddArchetype(); final GAV archetypeGAV = new GAV(archetypeGroupId.trim(), archetypeArtifactId.trim(), archetypeVersion.trim()); archetypeService.call(v -> { endAddArchetype(); hide(); }, addActionErrorCallback()).add(archetypeGAV); }); } @Inject  AddArchetypeModalPresenter(final View view,
                                      final TranslationService ts,
                                      final Caller<ArchetypeService> archetypeService,
                                      final BusyIndicatorView busyIndicatorView); @PostConstruct void postConstruct(); void show(); void hide(); void add(); void cancel(); @Override void showBusyIndicator(final String message); @Override void hideBusyIndicator();  }