Ejemplo n.º 1
0
 @Test
 public void shouldCreateWithViewArtifact() throws Exception {
   String artifact = "/WEB-INF/pages/page.xhtml";
   ViewArtifact viewArtifact = new ViewArtifact(artifact);
   FacesView view = new FacesView(viewArtifact);
   assertThat(view.getUrl(), is(artifact));
 }
Ejemplo n.º 2
0
 @Test
 public void shouldNotSetNullUrl() throws Exception {
   FacesView view = new FacesView();
   this.thrown.expect(IllegalArgumentException.class);
   this.thrown.expectMessage("URL must not be empty");
   view.setUrl(null);
 }
Ejemplo n.º 3
0
 @Test
 public void shouldRenderRemovingBindingResults() throws Exception {
   FacesView view = new FacesView();
   Map<String, Object> model = new HashMap<String, Object>();
   model.put("key", "value");
   model.put("binding", mock(BindingResult.class));
   view.renderMergedOutputModel(model, this.request, this.response);
   verify(this.springFacesContext).render(eq(view), this.modelCaptor.capture());
   assertThat(this.modelCaptor.getValue().size(), is(1));
   assertThat(this.modelCaptor.getValue().get("key"), is((Object) "value"));
 }
Ejemplo n.º 4
0
 @Test
 public void shouldCreateWithUrl() throws Exception {
   String url = "http://localhost:8080";
   FacesView view = new FacesView(url);
   assertThat(view.getUrl(), is(url));
 }
Ejemplo n.º 5
0
 @Test
 public void shouldGetViewArtifactFromUrl() throws Exception {
   FacesView view = new FacesView();
   view.setUrl("artifact");
   assertThat(view.getViewArtifact(), is(equalTo(new ViewArtifact("artifact"))));
 }