On Thu, Apr 24, 2008 at 6:56 AM, James Carman
<[EMAIL PROTECTED]> wrote:
> On Wed, Apr 23, 2008 at 10:06 PM, Ned Collyer <[EMAIL PROTECTED]> wrote:
> >
> > Hi I have the following, and its resulting in 2x calls to the load on my
> > model - which confuses me.
> >
> > My panel has the following in its constructor.
> >
> > setModel(new CompoundPropertyModel(new LoadableDetachableModel() {
> > protected Object load() {
> > return featureService.get(docRef);
> > }
> > }));
> >
> >
> > In my test I have:
> >
> >
> expect(mockFeatureService.get(testFeature.getDocRef())).andReturn(testFeature);
> > replay(mockFeatureService);
> >
> > applicationContext.putBean("featureService", mockFeatureService);
> >
> > wicketTester.startPanel(new TestPanelSource() {
> > public Panel getTestPanel(String panelId) {
> > return new TestFeatureShowPanel(panelId, testFeature.getDocRef());
> > }
> > });
> >
> > wicketTester.assertLabel("panel:title", testFeature.getTitle());
> >
> > verify(mockFeatureService);
Can you move the verify stuff up above the assertLabel? Would that
help? The verification you're looking for is to verify that stuff is
called correctly during rendering. The assertions don't need to go on
within the context of the "replay" of the mocks.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]