@Test public void shouldGet() throws Exception { mockMvc.perform(get("/foos/{id}", "cafe")) .andDo(print()) .andExpect(status().isOk()) .andExpect(content().contentType("application/hal+json")) .andExpect(jsonPath("$.uuid", is("cafe"))) .andExpect(jsonPath("$._links.self.href", is("http: }
@GetMapping("/{id}") public FooResource get(@PathVariable UUID id) { log.info("Get {}", id); Foo foo = new Foo(id, "Foo"); return assembler.toModel(foo); }
FooController { @GetMapping("/{id}") public FooResource get(@PathVariable UUID id) { log.info("Get {}", id); Foo foo = new Foo(id, "Foo"); return assembler.toModel(foo); } }
FooController { @GetMapping("/{id}") public FooResource get(@PathVariable UUID id) { log.info("Get {}", id); Foo foo = new Foo(id, "Foo"); return assembler.toModel(foo); } FooController(EntityLinks entityLinks); }
FooController { @GetMapping("/{id}") public FooResource get(@PathVariable UUID id) { log.info("Get {}", id); Foo foo = new Foo(id, "Foo"); return assembler.toModel(foo); } FooController(EntityLinks entityLinks); @GetMapping("/{id}") FooResource get(@PathVariable UUID id); @PutMapping("/{id}") HttpEntity<FooResource> update(@PathVariable UUID id, @RequestBody FooResource fooResource); @PostMapping HttpEntity<FooResource> create(@RequestBody FooResource fooResource); }
FooController { @GetMapping("/{id}") public FooResource get(@PathVariable UUID id) { log.info("Get {}", id); Foo foo = new Foo(id, "Foo"); return assembler.toModel(foo); } FooController(EntityLinks entityLinks); @GetMapping("/{id}") FooResource get(@PathVariable UUID id); @PutMapping("/{id}") HttpEntity<FooResource> update(@PathVariable UUID id, @RequestBody FooResource fooResource); @PostMapping HttpEntity<FooResource> create(@RequestBody FooResource fooResource);  }