From 94b85cdf7f1c98848b13eaaf0776af192aaba3cc Mon Sep 17 00:00:00 2001 From: Pierre-Gilles Leymarie Date: Thu, 6 Jun 2024 18:26:31 +0200 Subject: [PATCH] Re-Switch to Ecowatt v4 (#164) --- core/api/ecowatt/ecowatt.model.js | 2 +- test/core/api/ecowatt/ecowatt.controller.test.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/api/ecowatt/ecowatt.model.js b/core/api/ecowatt/ecowatt.model.js index f9abc74..fc402f7 100644 --- a/core/api/ecowatt/ecowatt.model.js +++ b/core/api/ecowatt/ecowatt.model.js @@ -30,7 +30,7 @@ module.exports = function EcowattModel(logger, redisClient) { }, }); - const { data } = await axios.get('https://digital.iservices.rte-france.com/open_api/ecowatt/v5/signals', { + const { data } = await axios.get('https://digital.iservices.rte-france.com/open_api/ecowatt/v4/signals', { headers: { authorization: `Bearer ${dataToken.access_token}`, }, diff --git a/test/core/api/ecowatt/ecowatt.controller.test.js b/test/core/api/ecowatt/ecowatt.controller.test.js index 2c18bfe..1310ae5 100644 --- a/test/core/api/ecowatt/ecowatt.controller.test.js +++ b/test/core/api/ecowatt/ecowatt.controller.test.js @@ -10,7 +10,7 @@ describe('GET /ecowatt/v4/signals', () => { access_token: 'access_token', expires_in: 100, }); - nock('https://digital.iservices.rte-france.com').get('/open_api/ecowatt/v5/signals').reply(200, { + nock('https://digital.iservices.rte-france.com').get('/open_api/ecowatt/v4/signals').reply(200, { data: true, }); const response = await request(TEST_BACKEND_APP) @@ -52,13 +52,13 @@ describe('GET /ecowatt/v4/signals', () => { access_token: 'access_token', expires_in: 100, }); - nock('https://digital.iservices.rte-france.com').get('/open_api/ecowatt/v5/signals').reply(429, { + nock('https://digital.iservices.rte-france.com').get('/open_api/ecowatt/v4/signals').reply(429, { error: 'too many requests', }); - nock('https://digital.iservices.rte-france.com').get('/open_api/ecowatt/v5/signals').reply(429, { + nock('https://digital.iservices.rte-france.com').get('/open_api/ecowatt/v4/signals').reply(429, { error: 'too many requests', }); - nock('https://digital.iservices.rte-france.com').get('/open_api/ecowatt/v5/signals').reply(200, { + nock('https://digital.iservices.rte-france.com').get('/open_api/ecowatt/v4/signals').reply(200, { data: true, }); const response = await request(TEST_BACKEND_APP)