test_class.declarator: contentType =
        new MediaType(
            MediaType.APPLICATION_JSON.getType(),
            MediaType.APPLICATION_JSON.getSubtype(),
            Charset.forName("utf8"))
test_class.modifier: private
test_class.original_string: private MediaType contentType =
        new MediaType(
            MediaType.APPLICATION_JSON.getType(),
            MediaType.APPLICATION_JSON.getSubtype(),
            Charset.forName("utf8"));
test_class.type: MediaType
test_class.var_name: contentType
test_class.declarator: mockMvc
test_class.modifier: private
test_class.original_string: private MockMvc mockMvc;
test_class.type: MockMvc
test_class.var_name: mockMvc
test_class.declarator: mappingJackson2HttpMessageConverter
test_class.modifier: private
test_class.original_string: private HttpMessageConverter<?> mappingJackson2HttpMessageConverter;
test_class.type: HttpMessageConverter<?>
test_class.var_name: mappingJackson2HttpMessageConverter
test_class.declarator: TEST_DEFAULT_SPACE = "public"
test_class.modifier: public static final
test_class.original_string: public static final String TEST_DEFAULT_SPACE = "public";
test_class.type: String
test_class.var_name: TEST_DEFAULT_SPACE
test_class.declarator: TEST_DEFAULT_TENANT = "default"
test_class.modifier: public static final
test_class.original_string: public static final String TEST_DEFAULT_TENANT = "default";
test_class.type: String
test_class.var_name: TEST_DEFAULT_TENANT
test_class.declarator: tenantRepository
test_class.modifier: @Autowired private
test_class.original_string: @Autowired private TenantRepository tenantRepository;
test_class.type: TenantRepository
test_class.var_name: tenantRepository
test_class.declarator: webApplicationContext
test_class.modifier: @Autowired private
test_class.original_string: @Autowired private WebApplicationContext webApplicationContext;
test_class.type: WebApplicationContext
test_class.var_name: webApplicationContext
test_class.file: rest-backend/src/test/java/org/eclipse/steady/backend/rest/TenantControllerTest.java
test_class.identifier: TenantControllerTest
test_case.body: @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)));
    }
test_case.class_method_signature: TenantControllerTest.testGetTenant()
test_case.full_signature: @Test public void testGetTenant()
test_case.identifier: testGetTenant
test_case.invocations: createDefaultTenant findOne findBySecondaryKey findDefault options andExpect perform isOk status accept get andExpect andExpect andExpect andExpect andExpect andExpect perform isOk status contentType content jsonPath is doesNotExist jsonPath jsonPath is jsonPath is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetTenant()
focal_class.declarator: log = LoggerFactory.getLogger(TenantController.class)
focal_class.modifier: private static
focal_class.original_string: private static Logger log = LoggerFactory.getLogger(TenantController.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: tenantRepository
focal_class.modifier: private
focal_class.original_string: private TenantRepository tenantRepository;
focal_class.type: TenantRepository
focal_class.var_name: tenantRepository
focal_class.declarator: cacheFilter
focal_class.modifier: private final
focal_class.original_string: private final Filter cacheFilter;
focal_class.type: Filter
focal_class.var_name: cacheFilter
focal_class.file: rest-backend/src/main/java/org/eclipse/steady/backend/rest/TenantController.java
focal_class.identifier: TenantController
focal_class.class_method_signature: TenantController.TenantController(TenantRepository tenantRepository, Filter cacheFilter)
focal_class.full_signature: @Autowired  TenantController(TenantRepository tenantRepository, Filter cacheFilter)
focal_class.identifier: TenantController
focal_class.modifiers: @Autowired
focal_class.parameters: (TenantRepository tenantRepository, Filter cacheFilter)
focal_class.signature:  TenantController(TenantRepository tenantRepository, Filter cacheFilter)
focal_class.class_method_signature: TenantController.getAllTenants()
focal_class.full_signature: @RequestMapping( value = "", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) @JsonView(Views.Default.class) public ResponseEntity<Iterable<Tenant>> getAllTenants()
focal_class.identifier: getAllTenants
focal_class.modifiers: @RequestMapping( value = "", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) @JsonView(Views.Default.class) public
focal_class.parameters: ()
focal_class.return: ResponseEntity<Iterable<Tenant>>
focal_class.signature: ResponseEntity<Iterable<Tenant>> getAllTenants()
focal_class.class_method_signature: TenantController.getDefaultTenant()
focal_class.full_signature: @RequestMapping( value = "default", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) @JsonView(Views.Default.class) public ResponseEntity<Tenant> getDefaultTenant()
focal_class.identifier: getDefaultTenant
focal_class.modifiers: @RequestMapping( value = "default", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) @JsonView(Views.Default.class) public
focal_class.parameters: ()
focal_class.return: ResponseEntity<Tenant>
focal_class.signature: ResponseEntity<Tenant> getDefaultTenant()
focal_class.class_method_signature: TenantController.isTenantExisting(@PathVariable String token)
focal_class.full_signature: @RequestMapping(value = "/{token:.+}", method = RequestMethod.OPTIONS) @JsonView(Views.Default.class) public ResponseEntity<Tenant> isTenantExisting(@PathVariable String token)
focal_class.identifier: isTenantExisting
focal_class.modifiers: @RequestMapping(value = "/{token:.+}", method = RequestMethod.OPTIONS) @JsonView(Views.Default.class) public
focal_class.parameters: (@PathVariable String token)
focal_class.return: ResponseEntity<Tenant>
focal_class.signature: ResponseEntity<Tenant> isTenantExisting(@PathVariable String token)
focal_class.class_method_signature: TenantController.createTenant(@RequestBody Tenant tenant)
focal_class.full_signature: @RequestMapping( value = "", method = RequestMethod.POST, consumes = {"application/json;charset=UTF-8"}, produces = {"application/json;charset=UTF-8"}) @JsonView(Views.Default.class) public ResponseEntity<Tenant> createTenant(@RequestBody Tenant tenant)
focal_class.identifier: createTenant
focal_class.modifiers: @RequestMapping( value = "", method = RequestMethod.POST, consumes = {"application/json;charset=UTF-8"}, produces = {"application/json;charset=UTF-8"}) @JsonView(Views.Default.class) public
focal_class.parameters: (@RequestBody Tenant tenant)
focal_class.return: ResponseEntity<Tenant>
focal_class.signature: ResponseEntity<Tenant> createTenant(@RequestBody Tenant tenant)
focal_class.class_method_signature: TenantController.getTenant(@PathVariable String token)
focal_class.full_signature: @RequestMapping( value = "/{token:.+}", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) @JsonView(Views.Default.class) public ResponseEntity<Tenant> getTenant(@PathVariable String token)
focal_class.identifier: getTenant
focal_class.modifiers: @RequestMapping( value = "/{token:.+}", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) @JsonView(Views.Default.class) public
focal_class.parameters: (@PathVariable String token)
focal_class.return: ResponseEntity<Tenant>
focal_class.signature: ResponseEntity<Tenant> getTenant(@PathVariable String token)
focal_class.class_method_signature: TenantController.modifyTenant(
        @PathVariable String token, @RequestBody Tenant new_tenant)
focal_class.full_signature: @RequestMapping( value = "/{token:.+}", method = RequestMethod.PUT, consumes = {"application/json;charset=UTF-8"}, produces = {"application/json;charset=UTF-8"}) @JsonView(Views.Default.class) public ResponseEntity<Tenant> modifyTenant(
        @PathVariable String token, @RequestBody Tenant new_tenant)
focal_class.identifier: modifyTenant
focal_class.modifiers: @RequestMapping( value = "/{token:.+}", method = RequestMethod.PUT, consumes = {"application/json;charset=UTF-8"}, produces = {"application/json;charset=UTF-8"}) @JsonView(Views.Default.class) public
focal_class.parameters: (
        @PathVariable String token, @RequestBody Tenant new_tenant)
focal_class.return: ResponseEntity<Tenant>
focal_class.signature: ResponseEntity<Tenant> modifyTenant(
        @PathVariable String token, @RequestBody Tenant new_tenant)
focal_class.class_method_signature: TenantController.deleteTenant(@PathVariable String token)
focal_class.full_signature: @RequestMapping(value = "/{token:.+}", method = RequestMethod.DELETE) @JsonView(Views.Default.class) public ResponseEntity<Tenant> deleteTenant(@PathVariable String token)
focal_class.identifier: deleteTenant
focal_class.modifiers: @RequestMapping(value = "/{token:.+}", method = RequestMethod.DELETE) @JsonView(Views.Default.class) public
focal_class.parameters: (@PathVariable String token)
focal_class.return: ResponseEntity<Tenant>
focal_class.signature: ResponseEntity<Tenant> deleteTenant(@PathVariable String token)
focal_method.body: @RequestMapping(
        value = "/{token:.+}",
        method = RequestMethod.GET,
        produces = {"application/json;charset=UTF-8"})
    @JsonView(Views.Default.class)
    public ResponseEntity<Tenant> getTenant(@PathVariable String token) {
      try {
        // Load existing tenant
        try {
          final Tenant tenant =
              TenantRepository.FILTER.findOne(this.tenantRepository.findBySecondaryKey(token));
          return new ResponseEntity<Tenant>(tenant, HttpStatus.OK);
        } catch (EntityNotFoundException enfe) {
          return new ResponseEntity<Tenant>(HttpStatus.NOT_FOUND);
        }
      } catch (Exception enfe) {
        return new ResponseEntity<Tenant>(HttpStatus.INTERNAL_SERVER_ERROR);
      }
    }
focal_method.class_method_signature: TenantController.getTenant(@PathVariable String token)
focal_method.full_signature: @RequestMapping( value = "/{token:.+}", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) @JsonView(Views.Default.class) public ResponseEntity<Tenant> getTenant(@PathVariable String token)
focal_method.identifier: getTenant
focal_method.invocations: findOne findBySecondaryKey
focal_method.modifiers: @RequestMapping( value = "/{token:.+}", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) @JsonView(Views.Default.class) public
focal_method.parameters: (@PathVariable String token)
focal_method.return: ResponseEntity<Tenant>
focal_method.signature: ResponseEntity<Tenant> getTenant(@PathVariable String token)