Esempio n. 1
0
  @Test
  public void getAudit() throws Exception {
    // Initialize the database
    auditEventRepository.save(auditEvent);

    // Get the audit
    restAuditMockMvc
        .perform(get("/api/audits/{id}", auditEvent.getId()))
        .andExpect(status().isOk())
        .andExpect(content().contentType(MediaType.APPLICATION_JSON))
        .andExpect(jsonPath("$.principal").value(SAMPLE_PRINCIPAL));
  }
Esempio n. 2
0
  @Test
  public void getAllAudits() throws Exception {
    // Initialize the database
    auditEventRepository.save(auditEvent);

    // Get all the audits
    restAuditMockMvc
        .perform(get("/api/audits"))
        .andExpect(status().isOk())
        // .andDo(print())
        .andExpect(content().contentType(MediaType.APPLICATION_JSON))
        .andExpect(jsonPath("$.[*].principal").value(hasItem(SAMPLE_PRINCIPAL)));
  }