109110111112113114115116117
oneOf(pMapper).execute(with(equalInternally(new FindByIdRequest("Person", 1L)))); will(returnValue(null)); } }); final ServiceActionContext currentContext = new ServiceActionContext(id, principalMock); sut.validate(currentContext); }
120121122123124125126127128
* bad param. */ @Test(expected = ValidationException.class) public void testBadParamvalidation() { final ServiceActionContext currentContext = new ServiceActionContext("Bad param", principalMock); sut.validate(currentContext); }
394041424344454647
{ Stream stream = new Stream(); stream.setName("something"); stream.setRequest("{ query : { recipient: [ { name: 'something', type: 'GROUP' } ] } }"); PrincipalActionContext actionContext = new ServiceActionContext(stream, null); sut.validate(actionContext); }
535455565758596061
public void testInvalidEmpty() { Stream stream = new Stream(); stream.setName(""); PrincipalActionContext actionContext = new ServiceActionContext(stream, null); sut.validate(actionContext); }
676869707172737475
public void testInvalidNull() { Stream stream = new Stream(); stream.setName(null); PrincipalActionContext actionContext = new ServiceActionContext(stream, null); sut.validate(actionContext); }
828384858687888990
{ Stream stream = new Stream(); stream.setName("something"); stream.setRequest("{ query : { recipient: [ ] } }"); PrincipalActionContext actionContext = new ServiceActionContext(stream, null); sut.validate(actionContext); }
112113114115116117118119120
request += "] } }"; stream.setRequest(request); PrincipalActionContext actionContext = new ServiceActionContext(stream, null); sut.validate(actionContext); }
128129130131132133134135136
Stream stream = new Stream(); stream.setName("something"); // Missing open curly brace stream.setRequest(" query : { recipient: [ ] } }"); PrincipalActionContext actionContext = new ServiceActionContext(stream, null); sut.validate(actionContext); }
89909192939495969798
oneOf(getPersonIdByAccountIdMapper).execute("followingntaccount"); will(returnValue(2L)); } }); ServiceActionContext currentContext = new ServiceActionContext(request, principalMock); sut.validate(currentContext); context.assertIsSatisfied(); }
115116117118119120121122123124125
}); Map<String, String> errors = null; try { ServiceActionContext currentContext = new ServiceActionContext(request, principalMock); sut.validate(currentContext); } catch (ValidationException vex) { errors = vex.getErrors();