Search in sources :

Example 1 with PackageDefinitionService

use of com.thoughtworks.go.server.service.materials.PackageDefinitionService in project gocd by gocd.

the class PackageDefinitionCreatorTest method setup.

@Before
public void setup() {
    packageDefinitionService = mock(PackageDefinitionService.class);
    doNothing().when(packageDefinitionService).performPluginValidationsFor(any(PackageDefinition.class));
    cruiseConfig = mock(BasicCruiseConfig.class);
    packageRepository = PackageRepositoryMother.create(repoId);
    packageDefinition = PackageDefinitionMother.create(pkgId);
    packageRepository.addPackage(packageDefinition);
    when(cruiseConfig.getPackageRepositories()).thenReturn(new PackageRepositories(packageRepository));
    doNothing().when(cruiseConfig).savePackageDefinition(any(PackageDefinition.class));
}
Also used : PackageDefinitionService(com.thoughtworks.go.server.service.materials.PackageDefinitionService) PackageDefinition(com.thoughtworks.go.domain.packagerepository.PackageDefinition) BasicCruiseConfig(com.thoughtworks.go.config.BasicCruiseConfig) PackageRepositories(com.thoughtworks.go.domain.packagerepository.PackageRepositories) Before(org.junit.Before)

Aggregations

BasicCruiseConfig (com.thoughtworks.go.config.BasicCruiseConfig)1 PackageDefinition (com.thoughtworks.go.domain.packagerepository.PackageDefinition)1 PackageRepositories (com.thoughtworks.go.domain.packagerepository.PackageRepositories)1 PackageDefinitionService (com.thoughtworks.go.server.service.materials.PackageDefinitionService)1 Before (org.junit.Before)1