Search in sources :

Example 1 with SourceStorageParametersValidator

use of org.eclipse.che.api.factory.server.impl.SourceStorageParametersValidator in project che by eclipse.

the class FactoryServiceTest method setUp.

@BeforeMethod
public void setUp() throws Exception {
    factoryBuilderSpy = spy(new FactoryBuilder(new SourceStorageParametersValidator()));
    factoryParametersResolvers = new HashSet<>();
    doNothing().when(factoryBuilderSpy).checkValid(any(FactoryDto.class));
    doNothing().when(factoryBuilderSpy).checkValid(any(FactoryDto.class), anyBoolean());
    when(factoryParametersResolverHolder.getFactoryParametersResolvers()).thenReturn(factoryParametersResolvers);
    user = new UserImpl(USER_ID, USER_EMAIL, ADMIN_USER_NAME);
    when(userManager.getById(anyString())).thenReturn(user);
    when(preferenceManager.find(USER_ID)).thenReturn(ImmutableMap.of("preference", "value"));
    service = new FactoryService(factoryManager, userManager, preferenceManager, createValidator, acceptValidator, editValidator, factoryBuilderSpy, workspaceManager, factoryParametersResolverHolder);
}
Also used : FactoryDto(org.eclipse.che.api.factory.shared.dto.FactoryDto) UserImpl(org.eclipse.che.api.user.server.model.impl.UserImpl) SourceStorageParametersValidator(org.eclipse.che.api.factory.server.impl.SourceStorageParametersValidator) FactoryBuilder(org.eclipse.che.api.factory.server.builder.FactoryBuilder) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

FactoryBuilder (org.eclipse.che.api.factory.server.builder.FactoryBuilder)1 SourceStorageParametersValidator (org.eclipse.che.api.factory.server.impl.SourceStorageParametersValidator)1 FactoryDto (org.eclipse.che.api.factory.shared.dto.FactoryDto)1 UserImpl (org.eclipse.che.api.user.server.model.impl.UserImpl)1 BeforeMethod (org.testng.annotations.BeforeMethod)1