@Test public void getDomain() throws Exception { domainRepository.save(domain); restDomainMockMvc.perform(get("/app/rest/domains/{id}", domain.getId())) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$.id").value(domain.getId())) .andExpect(jsonPath("$.name").value(DEFAULT_NAME.toString())); }
@RequestMapping(value = "/rest/domains/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public ResponseEntity<Domain> get(@PathVariable String id) { log.debug("REST request to get Domain : {}", id); return Optional.ofNullable(domainRepository.findOne(id)) .map(domain -> new ResponseEntity<>( domain, HttpStatus.OK)) .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND)); }
DomainResource { @RequestMapping(value = "/rest/domains/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public ResponseEntity<Domain> get(@PathVariable String id) { log.debug("REST request to get Domain : {}", id); return Optional.ofNullable(domainRepository.findOne(id)) .map(domain -> new ResponseEntity<>( domain, HttpStatus.OK)) .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND)); } }
DomainResource { @RequestMapping(value = "/rest/domains/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public ResponseEntity<Domain> get(@PathVariable String id) { log.debug("REST request to get Domain : {}", id); return Optional.ofNullable(domainRepository.findOne(id)) .map(domain -> new ResponseEntity<>( domain, HttpStatus.OK)) .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND)); }  }
DomainResource { @RequestMapping(value = "/rest/domains/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public ResponseEntity<Domain> get(@PathVariable String id) { log.debug("REST request to get Domain : {}", id); return Optional.ofNullable(domainRepository.findOne(id)) .map(domain -> new ResponseEntity<>( domain, HttpStatus.OK)) .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND)); }  @RequestMapping(value = "/rest/domains", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @Timed void create(@RequestBody Domain domain); @RequestMapping(value = "/rest/domains", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed List<Domain> getAll(); @RequestMapping(value = "/rest/domains/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed ResponseEntity<Domain> get(@PathVariable String id); @RequestMapping(value = "/rest/domains/{id}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) @Timed void delete(@PathVariable String id); }
DomainResource { @RequestMapping(value = "/rest/domains/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public ResponseEntity<Domain> get(@PathVariable String id) { log.debug("REST request to get Domain : {}", id); return Optional.ofNullable(domainRepository.findOne(id)) .map(domain -> new ResponseEntity<>( domain, HttpStatus.OK)) .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND)); }  @RequestMapping(value = "/rest/domains", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @Timed void create(@RequestBody Domain domain); @RequestMapping(value = "/rest/domains", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed List<Domain> getAll(); @RequestMapping(value = "/rest/domains/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Timed ResponseEntity<Domain> get(@PathVariable String id); @RequestMapping(value = "/rest/domains/{id}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) @Timed void delete(@PathVariable String id);  }