    @Test
    public void deleteDomain() throws Exception {

        // Initialize the database
        domainRepository.save(domain);

        // Get the domain
        restDomainMockMvc.perform(delete("/app/rest/domains/{id}", domain.getId())
                .accept(TestUtil.APPLICATION_JSON_UTF8))
                .andExpect(status().isOk());

        // Validate the database is empty
        List<Domain> domains = domainRepository.findAll();
        assertThat(domains).hasSize(0);
    }