Commit 935c67e0 authored by Deniro StopCovid's avatar Deniro StopCovid

feat: Use the property var robert.server.request-time-delta-tolerance mapped...

feat: Use the property var robert.server.request-time-delta-tolerance mapped on the env var ROBERT_SERVER_REQUEST_TIME_DELTA_TOLERANCE
parent ad4edaf0
......@@ -19,7 +19,7 @@
<groupId>fr.gouv.stopc</groupId>
<artifactId>robert-server</artifactId>
<version>1.6.0-SNAPSHOT</version>
<version>1.7.0-SNAPSHOT</version>
<name>robert-server</name>
<packaging>pom</packaging>
<description>Projet principal</description>
......
......@@ -13,7 +13,7 @@
<parent>
<groupId>fr.gouv.stopc</groupId>
<artifactId>robert-server</artifactId>
<version>1.6.0-SNAPSHOT</version>
<version>1.7.0-SNAPSHOT</version>
</parent>
<artifactId>robert-crypto-grpc-server-messaging</artifactId>
......
......@@ -13,7 +13,7 @@
<parent>
<groupId>fr.gouv.stopc</groupId>
<artifactId>robert-server</artifactId>
<version>1.6.0-SNAPSHOT</version>
<version>1.7.0-SNAPSHOT</version>
</parent>
......
......@@ -13,7 +13,7 @@
<parent>
<groupId>fr.gouv.stopc</groupId>
<artifactId>robert-server</artifactId>
<version>1.6.0-SNAPSHOT</version>
<version>1.7.0-SNAPSHOT</version>
</parent>
<artifactId>robert-crypto-grpc-server</artifactId>
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<licenses>
......@@ -15,7 +13,7 @@
<parent>
<groupId>fr.gouv.stopc</groupId>
<artifactId>robert-server</artifactId>
<version>1.6.0-SNAPSHOT</version>
<version>1.7.0-SNAPSHOT</version>
</parent>
<artifactId>robert-server-batch</artifactId>
......
......@@ -5,14 +5,12 @@ import org.springframework.stereotype.Component;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* Configuration class of the scoring algorithm
*
*/
@Getter
@ToString
@Setter
@Component
@ConfigurationProperties(prefix = "robert.scoring")
......
......@@ -33,3 +33,5 @@ robert.scoring.batch-mode=${ROBERT_SCORING_BATCH_MODE:SCORE_CONTACTS_AND_COMPUTE
robert.server.time-start=20200601
robert.protocol.contagious-period=14
robert.protocol.hello-message-timestamp-tolerance=180
spring.cloud.consul.config.watch.enabled=false
......@@ -13,7 +13,7 @@
<parent>
<groupId>fr.gouv.stopc</groupId>
<artifactId>robert-server</artifactId>
<version>1.6.0-SNAPSHOT</version>
<version>1.7.0-SNAPSHOT</version>
</parent>
<artifactId>robert-server-common</artifactId>
......
......@@ -13,7 +13,7 @@
<parent>
<groupId>fr.gouv.stopc</groupId>
<artifactId>robert-server</artifactId>
<version>1.6.0-SNAPSHOT</version>
<version>1.7.0-SNAPSHOT</version>
</parent>
<artifactId>robert-server-crypto</artifactId>
......
......@@ -13,7 +13,7 @@
<parent>
<groupId>fr.gouv.stopc</groupId>
<artifactId>robert-server</artifactId>
<version>1.6.0-SNAPSHOT</version>
<version>1.7.0-SNAPSHOT</version>
</parent>
......
......@@ -13,7 +13,7 @@
<parent>
<groupId>fr.gouv.stopc</groupId>
<artifactId>robert-server</artifactId>
<version>1.6.0-SNAPSHOT</version>
<version>1.7.0-SNAPSHOT</version>
</parent>
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<licenses>
......@@ -15,7 +13,7 @@
<parent>
<groupId>fr.gouv.stopc</groupId>
<artifactId>robert-server</artifactId>
<version>1.6.0-SNAPSHOT</version>
<version>1.7.0-SNAPSHOT</version>
</parent>
<artifactId>robert-server-ws-rest</artifactId>
......@@ -124,6 +122,18 @@
<artifactId>spring-cloud-starter-consul-config</artifactId>
</dependency>
<!-- Micrometer core dependecy -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
</dependency>
<!-- Micrometer Prometheus registry -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
</dependencies>
<build>
......
......@@ -35,8 +35,6 @@ import fr.gouv.stopc.robertserver.ws.vo.PushInfoVo;
@TestPropertySource("classpath:application.properties")
public class RestApiServiceImplTest {
private static final String SHOULD_NOT_FAIL = "It should not fail";
@InjectMocks
private RestApiServiceImpl restApiServiceImpl;
......@@ -259,41 +257,8 @@ public class RestApiServiceImplTest {
// Then
verify(this.webClient, never()).post();
}
// @Test
// public void testRegisterPushNotifShouldNotThrownAnExceptionEvenIfCallFail() {
//
// // Given
// PushInfoVo pushInfo = PushInfoVo.builder().build();
//
// when(this.restTemplate.postForEntity(any(URI.class), any(PushInfoVo.class), any()))
// .thenThrow(new HttpClientErrorException(HttpStatus.BAD_REQUEST));
//
// // When
// this.restApiServiceImpl.registerPushNotif(pushInfo);
//
// // Then
// verify(this.restTemplate).postForEntity(any(URI.class), any(PushInfoVo.class), any());
// }
// @Test
// public void testRegisterPushNotifShouldCallPushServerWhenPushInfoIsNotNull() {
//
// try {
// // Given
// PushInfoVo pushInfo = PushInfoVo.builder().build();
//
// // When
// this.restApiServiceImpl.registerPushNotif(pushInfo);
//
// // Then
// verify(this.webClient, never()).post();
// } catch (Exception e) {
//
// fail(SHOULD_NOT_FAIL);
// }
// }
}
@Test
public void testUnregisterPushNotifShouldNotCallPushServerWhenPushTokenIsNull() {
......@@ -308,66 +273,4 @@ public class RestApiServiceImplTest {
verify(this.webClient, never()).delete();
}
// @Test
// public void testUnregisterPushNotifShouldNotCallPushServerWhenPushTokenIsEmpty() {
//
// // Given
// String pushToken = "";
//
// // When
// this.restApiServiceImpl.unregisterPushNotif(pushToken);
//
// // Then
// verify(this.webClient, never()).delete();
// }
//
// @Test
// public void testUnregisterPushNotifShouldCallPushServerWhenPushTokenIsNotEmpty() {
//
// try {
// // Given
// String pushToken = "token";
//
// // When
// this.restApiServiceImpl.unregisterPushNotif(pushToken);
//
// // Then
// verify(this.webClient).delete();
//
// } catch (Exception e) {
// fail("EEEEE = " + e);
// }
// }
// @Test
// public void testUnregisterPushNotifShouldCallPushServerThrownAnExceptionEvenIfCallFail() {
//
// // Given
// String pushToken = "token";
//
// when(this.restTemplate.exchange(this.buildRegistertPushNotifURI(pushToken), HttpMethod.DELETE, null, Object.class))
// .thenThrow(new HttpClientErrorException(HttpStatus.BAD_REQUEST));
//
//
// // When
// this.restApiServiceImpl.unregisterPushNotif(pushToken);
//
// // Then
// verify(this.restTemplate).exchange(this.buildRegistertPushNotifURI(pushToken), HttpMethod.DELETE, null, Object.class);
// }
// private URI buildRegistertPushNotifURI(String pushToken) {
//
// Map<String, String> parameters = new HashMap<>();
// parameters.put("token", pushToken);
//
// return UriComponentsBuilder.newInstance().scheme("http")
// .host(this.propertyLoader.getPushServerHost())
// .port(this.propertyLoader.getPushServerPort())
// .path(this.propertyLoader.getInternalPathPrefix())
// .path(this.propertyLoader.getPushApiVersion())
// .path(this.propertyLoader.getPushApiPath())
// .path(this.propertyLoader.getPushApiTokenPath())
// .build(parameters);
// }
}
......@@ -63,3 +63,4 @@ robert.app.status-request-minimum-epoch-gap=2
# Push server Timeout
push.server.connection.timeout-millis=10000
push.server.global.timeout=10
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment