java - In Spring Webflow unit test, how do you assert that a view state has a view of a given name? -


I am developing a spring webflow, trying to use TDD, so I have to remove the abstraction flav accession trays Has extended. I can not see a clear way of claiming what I thought that would be a simple thing: a visible state has an associated view of a given name, for example, this flow (fraction) was given:

  & lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Flow ... & gt; ... & lt; View-state ID = "foo" visible = "bar view" & gt; & Lt; / Visual state & gt; & Lt; / Flow & gt;  

and the unit test

  public award testAssetFootsthatAssuranceView () {... assertCurrentStateEquals ("foo"); GetState ("Confirmation"). IsViewState ()); // Definitely an easy way ...? ViewState ViewState = (ViewState) getFlowDefinition () GetState ("foo"); View view = viewState.getViewFactory (). GetView (new MockRequestContext ()); // Yuk! AssertTrue (.view.toString () includes ("barView")); }  

See the state foo on barview ?

You can use it:

  AssertResponseWrittenEquals ("Barview", references);  

Where context is your MockExternalContext .

I always check that in such a way.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -