### Question:
ArtistController { @PostMapping(value="/artists", produces = MediaType.APPLICATION_JSON_VALUE) Artist saveArtist(@RequestBody Artist artist) { return service.findArtistByName(artist.getName()); } ArtistController(MusicRepository service);   }### Answer:
@Test(dependsOnMethods = "testSearches") public void testSaveArtist() { String url = "http: Artist newArtist = new Artist(0, "The Broken Keyboards"); ResponseEntity<Artist> response = restTemplate.postForEntity( url, newArtist, Artist.class ); assertEquals(response.getStatusCode(), HttpStatus.OK); Artist artist = response.getBody(); assertNotNull(artist); int id = artist.getId(); assertNotEquals(id, 0); assertEquals(artist.getName(), newArtist.getName()); response = restTemplate.getForEntity(url + "/" + id, Artist.class); assertEquals(response.getStatusCode(), HttpStatus.OK); Artist foundArtist = response.getBody(); assertNotNull(foundArtist); assertEquals(artist, foundArtist); }