use of com.thoughtworks.go.server.perf.MDUPerformanceLogger in project gocd by gocd.
the class MaterialUpdateServiceTest method setUp.
@Before
public void setUp() throws Exception {
queue = mock(MaterialUpdateQueue.class);
configQueue = mock(ConfigMaterialUpdateQueue.class);
watchList = mock(GoConfigWatchList.class);
completed = mock(MaterialUpdateCompletedTopic.class);
goConfigService = mock(GoConfigService.class);
postCommitHookMaterialType = mock(PostCommitHookMaterialTypeResolver.class);
serverHealthService = mock(ServerHealthService.class);
systemEnvironment = new SystemEnvironment();
scmMaterialSource = mock(SCMMaterialSource.class);
dependencyMaterialUpdateNotifier = mock(DependencyMaterialUpdateNotifier.class);
materialConfigConverter = mock(MaterialConfigConverter.class);
MDUPerformanceLogger mduPerformanceLogger = mock(MDUPerformanceLogger.class);
dependencyMaterialUpdateQueue = mock(DependencyMaterialUpdateQueue.class);
service = new MaterialUpdateService(queue, configQueue, completed, watchList, goConfigService, systemEnvironment, serverHealthService, postCommitHookMaterialType, mduPerformanceLogger, materialConfigConverter, dependencyMaterialUpdateQueue);
service.registerMaterialSources(scmMaterialSource);
service.registerMaterialUpdateCompleteListener(scmMaterialSource);
service.registerMaterialUpdateCompleteListener(dependencyMaterialUpdateNotifier);
HashSet<MaterialConfig> materialConfigs = new HashSet(Collections.singleton(MATERIAL_CONFIG));
HashSet<Material> materials = new HashSet(Collections.singleton(svnMaterial));
when(goConfigService.getSchedulableMaterials()).thenReturn(materialConfigs);
when(materialConfigConverter.toMaterials(materialConfigs)).thenReturn(materials);
username = new Username(new CaseInsensitiveString("loser"));
result = new HttpLocalizedOperationResult();
validMaterialType = mock(PostCommitHookMaterialType.class);
when(validMaterialType.isKnown()).thenReturn(true);
when(validMaterialType.isValid(anyString())).thenReturn(true);
invalidMaterialType = mock(PostCommitHookMaterialType.class);
when(invalidMaterialType.isKnown()).thenReturn(false);
when(invalidMaterialType.isValid(anyString())).thenReturn(false);
}
Aggregations