@Test void testStateRestBuilderAll(){
URI uri = UriComponentsBuilder
.fromHttpUrl("http://127.0.0.1:9090/coches/all")
.build().encode().toUri();
RequestEntity<Object> requestEntity = new RequestEntity<>(HttpMethod.GET, uri);
ResponseEntity<String> responseEntity = new RestTemplate().exchange(requestEntity, String.class);
String response = responseEntity.getBody();
Gson gson = new Gson();
String jsonString = gson.toJson(methodCreation());
assertEquals(jsonString,response);
}
@Test
void testStateRestBuilderId(){
int indice = 1;
URI uri = UriComponentsBuilder
.fromHttpUrl("http://127.0.0.1:9090/coches/"+""+indice)
.build().encode().toUri();
RequestEntity<Object> requestEntity = new RequestEntity<>(HttpMethod.GET, uri);
ResponseEntity<String> responseEntity = new RestTemplate().exchange(requestEntity, String.class);
String response = responseEntity.getBody();
assertEquals(methodCreation(indice),response);
}