Search in sources :

Example 6 with Espetaculo

use of br.com.caelum.agiletickets.models.Espetaculo in project agiletickets by caelum.

the class EspetaculosController method carregaEspetaculo.

private Espetaculo carregaEspetaculo(Long espetaculoId) {
    Espetaculo espetaculo = agenda.espetaculo(espetaculoId);
    if (espetaculo == null) {
        validator.add(new ValidationMessage("", ""));
    }
    validator.onErrorUse(status()).notFound();
    return espetaculo;
}
Also used : ValidationMessage(br.com.caelum.vraptor.validator.ValidationMessage) Espetaculo(br.com.caelum.agiletickets.models.Espetaculo)

Example 7 with Espetaculo

use of br.com.caelum.agiletickets.models.Espetaculo in project agiletickets by caelum.

the class EspetaculosControllerTest method naoDeveCadastrarEspetaculosSemNome.

@Test(expected = ValidationException.class)
public void naoDeveCadastrarEspetaculosSemNome() throws Exception {
    Espetaculo espetaculo = new Espetaculo();
    espetaculo.setDescricao("uma descricao");
    controller.adiciona(espetaculo);
    verifyZeroInteractions(agenda);
}
Also used : Espetaculo(br.com.caelum.agiletickets.models.Espetaculo) TipoDeEspetaculo(br.com.caelum.agiletickets.models.TipoDeEspetaculo) Test(org.junit.Test)

Example 8 with Espetaculo

use of br.com.caelum.agiletickets.models.Espetaculo in project agiletickets by caelum.

the class EspetaculosControllerTest method naoDeveCadastrarEspetaculosSemDescricao.

@Test(expected = ValidationException.class)
public void naoDeveCadastrarEspetaculosSemDescricao() throws Exception {
    Espetaculo espetaculo = new Espetaculo();
    espetaculo.setNome("um nome");
    controller.adiciona(espetaculo);
    verifyZeroInteractions(agenda);
}
Also used : Espetaculo(br.com.caelum.agiletickets.models.Espetaculo) TipoDeEspetaculo(br.com.caelum.agiletickets.models.TipoDeEspetaculo) Test(org.junit.Test)

Example 9 with Espetaculo

use of br.com.caelum.agiletickets.models.Espetaculo in project agiletickets by caelum.

the class SessaoTestDataBuilder method deUmEspetaculoDoTipo.

public SessaoTestDataBuilder deUmEspetaculoDoTipo(TipoDeEspetaculo tipo) {
    this.espetaculo = new Espetaculo();
    this.espetaculo.setTipo(tipo);
    return this;
}
Also used : Espetaculo(br.com.caelum.agiletickets.models.Espetaculo) TipoDeEspetaculo(br.com.caelum.agiletickets.models.TipoDeEspetaculo)

Aggregations

Espetaculo (br.com.caelum.agiletickets.models.Espetaculo)9 TipoDeEspetaculo (br.com.caelum.agiletickets.models.TipoDeEspetaculo)6 Test (org.junit.Test)4 Sessao (br.com.caelum.agiletickets.models.Sessao)3 Path (br.com.caelum.vraptor.Path)2 BigDecimal (java.math.BigDecimal)2 Estabelecimento (br.com.caelum.agiletickets.models.Estabelecimento)1 Get (br.com.caelum.vraptor.Get)1 Post (br.com.caelum.vraptor.Post)1 EntityManagerCreator (br.com.caelum.vraptor.util.jpa.EntityManagerCreator)1 EntityManagerFactoryCreator (br.com.caelum.vraptor.util.jpa.EntityManagerFactoryCreator)1 ValidationMessage (br.com.caelum.vraptor.validator.ValidationMessage)1 EntityManager (javax.persistence.EntityManager)1 DateTime (org.joda.time.DateTime)1