@Before public void prepare() { Mockito.when(systemStatus.isNexusStarted()).thenReturn(true); Mockito.when(applicationStatusSource.getSystemStatus()).thenReturn(systemStatus); Mockito.when(mavenProxyRepository.getId()).thenReturn("central"); Mockito.when(mavenProxyRepository.getName()).thenReturn("Central Repository"); }
@Before public void setup() { this.underTest = new DefaultUserAgentBuilder(statusSource, contributors); when(statusSource.getSystemStatus()).thenReturn(status); when(status.getVersion()).thenReturn("2.1-FAKE"); when(status.getEditionShort()).thenReturn("FAKENEXUS"); when(ctx.getRemoteConnectionSettings()).thenReturn(settings); when(settings.getUserAgentCustomizationString()).thenReturn("SETTINGS_CUSTOMIZATION"); when(repository.getRemoteStorage()).thenReturn(storage); when(storage.getProviderId()).thenReturn("RRS_PROVIDER"); when(storage.getVersion()).thenReturn("RRS_VERSION"); when(contributor.getUserAgent(ctx, repository)).thenReturn("PLUGIN_CONTRIBUTED"); }