use of org.eclipse.che.api.factory.shared.dto.AuthorDto in project che by eclipse.
the class FactoryEditValidatorImplTest method testUserIsNotTheAuthor.
/**
* Check when user is not same than the one than create the factory
* @throws ApiException
*/
@Test(expectedExceptions = ForbiddenException.class)
public void testUserIsNotTheAuthor() throws ApiException {
String userId = "florent";
setCurrentUser(userId);
AuthorDto author = mock(AuthorDto.class);
doReturn(author).when(factory).getCreator();
doReturn("john").when(author).getUserId();
factoryEditValidator.validate(factory);
}
use of org.eclipse.che.api.factory.shared.dto.AuthorDto in project che by eclipse.
the class FactoryEditValidatorImplTest method testUserIsTheAuthor.
/**
* Check when user is the same than the one than create the factory
* @throws ApiException
*/
@Test
public void testUserIsTheAuthor() throws ApiException {
String userId = "florent";
setCurrentUser(userId);
AuthorDto author = mock(AuthorDto.class);
doReturn(author).when(factory).getCreator();
doReturn(userId).when(author).getUserId();
factoryEditValidator.validate(factory);
}