@Test public void testValidate() { final ServiceActionContext currentContext = new ServiceActionContext(1L, principalMock); context.checking(new Expectations() { { oneOf(tutorialVideoMapperMock).execute(with(equalInternally(new FindByIdRequest("TutorialVideo", 1L)))); will(returnValue(tutorialVideoMock)); } }); sut.validate(currentContext); context.assertIsSatisfied(); }
@Override public void validate(final ServiceActionContext inActionContext) throws ValidationException { Long videoID = (Long) inActionContext.getParams(); if (optOutVideoMapper.execute(new FindByIdRequest("TutorialVideo", videoID)) == null) { throw (new ValidationException("Not a valid video id")); } }
SetOptOutVideoValidation implements ValidationStrategy<ServiceActionContext> { @Override public void validate(final ServiceActionContext inActionContext) throws ValidationException { Long videoID = (Long) inActionContext.getParams(); if (optOutVideoMapper.execute(new FindByIdRequest("TutorialVideo", videoID)) == null) { throw (new ValidationException("Not a valid video id")); } } }
SetOptOutVideoValidation implements ValidationStrategy<ServiceActionContext> { @Override public void validate(final ServiceActionContext inActionContext) throws ValidationException { Long videoID = (Long) inActionContext.getParams(); if (optOutVideoMapper.execute(new FindByIdRequest("TutorialVideo", videoID)) == null) { throw (new ValidationException("Not a valid video id")); } } SetOptOutVideoValidation(final FindByIdMapper<TutorialVideo> inOptOutVideoMapper); }
SetOptOutVideoValidation implements ValidationStrategy<ServiceActionContext> { @Override public void validate(final ServiceActionContext inActionContext) throws ValidationException { Long videoID = (Long) inActionContext.getParams(); if (optOutVideoMapper.execute(new FindByIdRequest("TutorialVideo", videoID)) == null) { throw (new ValidationException("Not a valid video id")); } } SetOptOutVideoValidation(final FindByIdMapper<TutorialVideo> inOptOutVideoMapper); @Override void validate(final ServiceActionContext inActionContext); }
SetOptOutVideoValidation implements ValidationStrategy<ServiceActionContext> { @Override public void validate(final ServiceActionContext inActionContext) throws ValidationException { Long videoID = (Long) inActionContext.getParams(); if (optOutVideoMapper.execute(new FindByIdRequest("TutorialVideo", videoID)) == null) { throw (new ValidationException("Not a valid video id")); } } SetOptOutVideoValidation(final FindByIdMapper<TutorialVideo> inOptOutVideoMapper); @Override void validate(final ServiceActionContext inActionContext);  }