@Test
public void testGetTenant() throws Exception {

  createDefaultTenant();
  // Read tenant from repo by token
  final Tenant tenant =
      TenantRepository.FILTER.findOne(
          this.tenantRepository.findBySecondaryKey(TEST_DEFAULT_TENANT));
  // Read default tenant
  final Tenant default_tenant = this.tenantRepository.findDefault();
  // Default tenant exists
  MockHttpServletRequestBuilder opts_builder = options("/tenants/" + TEST_DEFAULT_TENANT);
  mockMvc.perform(opts_builder).andExpect(status().isOk());
  // Default tenant members
  MockHttpServletRequestBuilder get_builder =
      get("/tenants/" + TEST_DEFAULT_TENANT).accept(MediaType.APPLICATION_JSON);
  mockMvc
      .perform(get_builder)
      .andExpect(status().isOk())
      .andExpect(content().contentType(contentType))
      //	.andExpect(content().json(JacksonUtil.asJsonString(default_tenant))) //the deserialized
      // tenant does not match the one read from the db as the spaces are not transfered
      .andExpect(jsonPath("$.default", is(true)))
      .andExpect(jsonPath("$.spaces").doesNotExist())
      .andExpect(jsonPath("$.tenantToken", is(TEST_DEFAULT_TENANT)))
      .andExpect(jsonPath("$.tenantName", is(TEST_DEFAULT_TENANT)));
}