ca marche pas

ArticleClient
felix 1 year ago
parent c3d9c2b976
commit c1a2e3bd9a

@ -40,6 +40,10 @@
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>
</dependencies>
<build>

@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.web.client.RestTemplate;
import SAE.ApiREST.Client.model.Article;
import SAE.ApiREST.Client.model.Response;
public class TestArticle {
private static final Logger log = LoggerFactory.getLogger(ClientApplication.class);
@ -16,14 +17,14 @@ public class TestArticle {
private RestTemplate restTemplate = new RestTemplate();
public TestArticle() {
testPost();
// testPost();
// testGetAllArticles();
testGetAllArticles();
testGetArticleById();
}
private void testPost() {
Article result = new Article();
Response result = new Response();
Article article = new Article(
"title",
@ -34,9 +35,10 @@ public class TestArticle {
1
);
result = restTemplate.getForObject(
baseURI + "/getArticleById/1",
Article.class
result = restTemplate.postForObject(
baseURI + "/addArticle",
article,
Response.class
);
log.info(result.toString());

Loading…
Cancel
Save