コード例 #1
0
 @Test
 public void shouldPrefixGerenciadorForPackagedControllers() {
   assertThat("/gerenciador", is(equalTo(cprp.prefixGerenciador(UsuarioController.class, ""))));
   assertThat("/gerenciador/", is(equalTo(cprp.prefixGerenciador(UsuarioController.class, "/"))));
   assertThat(
       "/gerenciador/bla", is(equalTo(cprp.prefixGerenciador(UsuarioController.class, "/bla"))));
 }
コード例 #2
0
  @Test
  public void shouldPrefixGerenciadorPlusControllerNameWhenFixingSlashUri() {
    String[] uris = {"/"};
    String[] fixedUris = {"/gerenciador/"};

    cprp.fixURIs(UsuarioController.class, uris);
    assertThat(uris, is(equalTo(fixedUris)));
  }
コード例 #3
0
  @Test
  public void shouldFixLeadingSlash() {
    String[] uris = {"bark"};
    String[] fixedUris = {"/dog/bark"};

    cprp.fixURIs(DogController.class, uris);
    assertThat(uris, is(equalTo(fixedUris)));
  }
コード例 #4
0
  @Test
  public void shouldOmitControllerNameFixingRootControllerUris() {
    String[] uris = {"", "/", "login", "/login"};
    String[] fixedUris = {
      "/gerenciador/", "/gerenciador/", "/gerenciador/login", "/gerenciador/login"
    };

    cprp.fixURIs(br.com.integrativa.icms.controller.RootController.class, uris);
    assertThat(uris, is(equalTo(fixedUris)));
  }
コード例 #5
0
 @Test
 public void shouldDefaultUriToVraptorConventionOtherwise() {
   assertThat(cprp.defaultUriFor("/", "sitemap"), is(equalTo("/sitemap")));
   assertThat(cprp.defaultUriFor("/dog", "bark"), is(equalTo("/dog/bark")));
 }
コード例 #6
0
 @Test
 public void shouldDefaultForEmptyPathWhenMethodNameIsIndex() {
   assertThat(cprp.defaultUriFor("/", "index"), is(equalTo("/")));
   assertThat(cprp.defaultUriFor("/login", "index"), is(equalTo("/login")));
 }
コード例 #7
0
 @Test
 public void shouldExtractControllerNameToVraptorConventionOtherwise() {
   assertThat(cprp.extractControllerNameFrom(DogController.class), is(equalTo("/dog")));
 }
コード例 #8
0
 @Test
 public void shouldExtractEmptyStringForRootController() {
   assertThat(
       cprp.extractControllerNameFrom(br.com.integrativa.bogus.controller.RootController.class),
       is(equalTo("/")));
 }