use of org.eclipse.che.api.factory.shared.dto.IdeActionDto in project che by eclipse.
the class FactoryBaseValidatorTest method shouldNotValidateIfOpenWelcomePageActionInsufficientParams.
@Test(expectedExceptions = BadRequestException.class)
public void shouldNotValidateIfOpenWelcomePageActionInsufficientParams() throws Exception {
//given
validator = new TesterFactoryBaseValidator();
List<IdeActionDto> actions = singletonList(newDto(IdeActionDto.class).withId("openWelcomePage"));
IdeDto ide = newDto(IdeDto.class).withOnAppLoaded((newDto(OnAppLoadedDto.class).withActions(actions)));
FactoryDto factoryWithAccountId = requireNonNull(getInstance().clone(factory)).withIde(ide);
//when
validator.validateProjectActions(factoryWithAccountId);
}
use of org.eclipse.che.api.factory.shared.dto.IdeActionDto in project che by eclipse.
the class FactoryBaseValidatorTest method shouldValidateFindReplaceAction.
@Test
public void shouldValidateFindReplaceAction() throws Exception {
//given
validator = new TesterFactoryBaseValidator();
Map<String, String> params = new HashMap<>();
params.put("in", "pom.xml");
params.put("find", "123");
params.put("replace", "456");
List<IdeActionDto> actions = singletonList(newDto(IdeActionDto.class).withId("findReplace").withProperties(params));
IdeDto ide = newDto(IdeDto.class).withOnProjectsLoaded(newDto(OnProjectsLoadedDto.class).withActions(actions));
FactoryDto factoryWithAccountId = requireNonNull(getInstance().clone(factory)).withIde(ide);
//when
validator.validateProjectActions(factoryWithAccountId);
}
use of org.eclipse.che.api.factory.shared.dto.IdeActionDto in project che by eclipse.
the class FactoryBaseValidatorTest method shouldNotValidateIfFindReplaceActionInsufficientParams.
@Test(expectedExceptions = BadRequestException.class)
public void shouldNotValidateIfFindReplaceActionInsufficientParams() throws Exception {
//given
validator = new TesterFactoryBaseValidator();
Map<String, String> params = new HashMap<>();
params.put("in", "pom.xml");
// find is missing!
params.put("replace", "123");
List<IdeActionDto> actions = singletonList(newDto(IdeActionDto.class).withId("findReplace").withProperties(params));
IdeDto ide = newDto(IdeDto.class).withOnProjectsLoaded(newDto(OnProjectsLoadedDto.class).withActions(actions));
FactoryDto factoryWithAccountId = requireNonNull(getInstance().clone(factory)).withIde(ide);
//when
validator.validateProjectActions(factoryWithAccountId);
}
use of org.eclipse.che.api.factory.shared.dto.IdeActionDto in project che by eclipse.
the class FactoryBaseValidatorTest method shouldNotValidateIfOpenfileActionInsufficientParams.
@Test(expectedExceptions = BadRequestException.class)
public void shouldNotValidateIfOpenfileActionInsufficientParams() throws Exception {
//given
validator = new TesterFactoryBaseValidator();
List<IdeActionDto> actions = singletonList(newDto(IdeActionDto.class).withId("openFile"));
IdeDto ide = newDto(IdeDto.class).withOnProjectsLoaded(newDto(OnProjectsLoadedDto.class).withActions(actions));
FactoryDto factoryWithAccountId = requireNonNull(getInstance().clone(factory)).withIde(ide);
//when
validator.validateProjectActions(factoryWithAccountId);
}
Aggregations