@Test
  @Transactional
  public void getAllFuncionarios() throws Exception {
    // Initialize the database
    Funcionario funcionario = funcionarioService.save(funcionarioDTO, "");
    funcionarioDTO.setId(funcionario.getId());

    // Get all the funcionarios
    restFuncionarioMockMvc
        .perform(get("/api/funcionarios"))
        .andExpect(status().isOk())
        .andExpect(content().contentType(MediaType.APPLICATION_JSON))
        .andExpect(jsonPath("$.[*].id").value(hasItem(funcionarioDTO.getId().intValue())))
        .andExpect(jsonPath("$.[*].nome").value(hasItem(DEFAULT_NOME.toString())))
        .andExpect(jsonPath("$.[*].cpf").value(hasItem(DEFAULT_CPF.toString())))
        .andExpect(jsonPath("$.[*].sexo").value(hasItem(DEFAULT_SEXO.toString())))
        .andExpect(jsonPath("$.[*].dataNascimento").value(hasItem(DEFAULT_DATA_NASCIMENTO_STR)))
        .andExpect(jsonPath("$.[*].email").value(hasItem(DEFAULT_EMAIL.toString())))
        .andExpect(jsonPath("$.[*].senha").value(hasItem(DEFAULT_SENHA.toString())))
        .andExpect(jsonPath("$.[*].ativo").value(hasItem(DEFAULT_ATIVO.booleanValue())))
        .andExpect(jsonPath("$.[*].numero").value(hasItem(DEFAULT_NUMERO)))
        .andExpect(jsonPath("$.[*].complemento").value(hasItem(DEFAULT_COMPLEMENTO.toString())))
        .andExpect(
            jsonPath("$.[*].responsavel").value(hasItem(DEFAULT_RESPONSAVEL.booleanValue())));
  }
  @Test
  @Transactional
  public void getShipOrder() throws Exception {
    // Initialize the database
    shipOrderRepository.saveAndFlush(shipOrder);

    // Get the shipOrder
    restShipOrderMockMvc
        .perform(get("/api/shipOrders/{id}", shipOrder.getId()))
        .andExpect(status().isOk())
        .andExpect(content().contentType(MediaType.APPLICATION_JSON))
        .andExpect(jsonPath("$.id").value(shipOrder.getId().intValue()))
        .andExpect(jsonPath("$.deliveryTimeStamp").value(DEFAULT_DELIVERY_TIME_STAMP.toString()))
        .andExpect(jsonPath("$.finalCosts").value(DEFAULT_FINAL_COSTS.doubleValue()))
        .andExpect(jsonPath("$.readyForShipping").value(DEFAULT_READY_FOR_SHIPPING.booleanValue()));
  }
  @Test
  @Transactional
  public void getSession() throws Exception {
    // Initialize the database
    sessionRepository.saveAndFlush(session);

    // Get the session
    restSessionMockMvc
        .perform(get("/api/sessions/{id}", session.getId()))
        .andExpect(status().isOk())
        .andExpect(content().contentType(MediaType.APPLICATION_JSON))
        .andExpect(jsonPath("$.id").value(session.getId().intValue()))
        .andExpect(jsonPath("$.sessionName").value(DEFAULT_SESSION_NAME.toString()))
        .andExpect(jsonPath("$.startTime").value(DEFAULT_START_TIME.toString()))
        .andExpect(jsonPath("$.endTime").value(DEFAULT_END_TIME.toString()))
        .andExpect(jsonPath("$.isBreak").value(DEFAULT_IS_BREAK.booleanValue()));
  }
Esempio n. 4
0
  @Test
  @Transactional
  public void getForum() throws Exception {
    // Initialize the database
    forumRepository.saveAndFlush(forum);

    // Get the forum
    restForumMockMvc
        .perform(get("/api/forums/{id}", forum.getId()))
        .andExpect(status().isOk())
        .andExpect(content().contentType(MediaType.APPLICATION_JSON))
        .andExpect(jsonPath("$.id").value(forum.getId().intValue()))
        .andExpect(jsonPath("$.name").value(DEFAULT_NAME.toString()))
        .andExpect(jsonPath("$.description").value(DEFAULT_DESCRIPTION.toString()))
        .andExpect(jsonPath("$.display").value(DEFAULT_DISPLAY))
        .andExpect(jsonPath("$.lft").value(DEFAULT_LFT))
        .andExpect(jsonPath("$.rgt").value(DEFAULT_RGT))
        .andExpect(jsonPath("$.postCount").value(DEFAULT_POST_COUNT))
        .andExpect(jsonPath("$.topicCount").value(DEFAULT_TOPIC_COUNT))
        .andExpect(jsonPath("$.locked").value(DEFAULT_LOCKED.booleanValue()));
  }