Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
ROBERT Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
24
Issues
24
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TousAntiCovid sources
ROBERT Server
Commits
0f5a86d4
Commit
0f5a86d4
authored
Jul 23, 2020
by
Deniro StopCovid
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/v1.4.2' into 'develop'
Merge Back Release/v1.4.2 See merge request
!89
parents
cf82e161
0dbadc7a
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
74 additions
and
69 deletions
+74
-69
robert-crypto-grpc-server/src/test/java/test/fr/gouv/stopc/robert/crypto/grpc/server/CryptoServiceGrpcServerTest.java
...obert/crypto/grpc/server/CryptoServiceGrpcServerTest.java
+3
-2
robert-server-batch/src/main/java/fr/gouv/stopc/robert/server/batch/configuration/ContactsProcessingConfiguration.java
.../batch/configuration/ContactsProcessingConfiguration.java
+5
-5
robert-server-batch/src/main/java/fr/gouv/stopc/robert/server/batch/processor/PurgeOldEpochExpositionsProcessor.java
...er/batch/processor/PurgeOldEpochExpositionsProcessor.java
+1
-0
robert-server-batch/src/test/java/test/fr/gouv/stopc/robertserver/batch/processor/ContactProcessorTest.java
...pc/robertserver/batch/processor/ContactProcessorTest.java
+2
-1
robert-server-batch/src/test/java/test/fr/gouv/stopc/robertserver/batch/processor/PurgeOldEpochExpositionsProcessorTest.java
...atch/processor/PurgeOldEpochExpositionsProcessorTest.java
+1
-1
robert-server-batch/src/test/java/test/fr/gouv/stopc/robertserver/batch/processor/RegistrationProcessorTest.java
...bertserver/batch/processor/RegistrationProcessorTest.java
+0
-2
robert-server-common/src/test/java/test/fr/gouv/stopc/robert/server/common/utils/TimeUtilsTest.java
.../gouv/stopc/robert/server/common/utils/TimeUtilsTest.java
+3
-2
robert-server-database/src/main/java/fr/gouv/stopc/robertserver/database/service/impl/ContactServiceImpl.java
...obertserver/database/service/impl/ContactServiceImpl.java
+1
-0
robert-server-database/src/main/java/fr/gouv/stopc/robertserver/database/service/impl/RegistrationService.java
...bertserver/database/service/impl/RegistrationService.java
+55
-55
robert-server-ws-rest/src/main/java/fr/gouv/stopc/robertserver/ws/service/impl/AuthRequestValidationServiceImpl.java
...ver/ws/service/impl/AuthRequestValidationServiceImpl.java
+1
-0
robert-server-ws-rest/src/test/java/test/fr/gouv/stopc/robertserver/ws/DeleteHistoryControllerWsRestTest.java
...pc/robertserver/ws/DeleteHistoryControllerWsRestTest.java
+1
-0
robert-server-ws-rest/src/test/java/test/fr/gouv/stopc/robertserver/ws/RegisterControllerWsRestTest.java
...v/stopc/robertserver/ws/RegisterControllerWsRestTest.java
+1
-1
No files found.
robert-crypto-grpc-server/src/test/java/test/fr/gouv/stopc/robert/crypto/grpc/server/CryptoServiceGrpcServerTest.java
View file @
0f5a86d4
...
...
@@ -1113,6 +1113,7 @@ class CryptoServiceGrpcServerTest {
(
stub
,
req
,
observer
)
->
stub
.
deleteId
(
req
,
observer
),
(
t
)
->
fail
(),
res
);
assertTrue
(!
res
.
isError
());
assertTrue
(
ByteUtils
.
isNotEmpty
(
response
.
getIdA
().
toByteArray
()));
assertTrue
(
Arrays
.
equals
(
clientIdentifierBundle
.
get
().
getId
(),
response
.
getIdA
().
toByteArray
()));
...
...
@@ -1144,10 +1145,10 @@ class CryptoServiceGrpcServerTest {
(
stub
,
req
,
observer
)
->
stub
.
deleteId
(
req
,
observer
),
(
t
)
->
fail
(),
res
);
assertTrue
(!
res
.
isError
());
assertTrue
(
response
.
hasError
());
assertTrue
(
response
.
getError
().
getCode
()
==
400
);
}
@Test
...
...
@@ -1427,7 +1428,7 @@ class CryptoServiceGrpcServerTest {
when
(
this
.
cryptographicStorageService
.
getServerKeys
(
this
.
currentEpochId
,
this
.
serverConfigurationService
.
getServiceTimeStart
(),
4
))
.
thenReturn
(
serverKeys
);
.
thenReturn
(
serverKeys
);
// Given
GetIdFromStatusRequest
request
=
GetIdFromStatusRequest
...
...
robert-server-batch/src/main/java/fr/gouv/stopc/robert/server/batch/configuration/ContactsProcessingConfiguration.java
View file @
0f5a86d4
...
...
@@ -23,7 +23,7 @@ import org.springframework.batch.item.data.builder.MongoItemWriterBuilder;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.task.S
impleAs
yncTaskExecutor
;
import
org.springframework.core.task.SyncTaskExecutor
;
import
org.springframework.core.task.TaskExecutor
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.domain.Sort.Direction
;
...
...
@@ -228,7 +228,7 @@ public class ContactsProcessingConfiguration {
public
TaskExecutor
taskExecutor
()
{
return
new
S
impleAs
yncTaskExecutor
();
return
new
SyncTaskExecutor
();
}
public
Step
contactWorkerStep
(
StepBuilderFactory
stepBuilderFactory
,
MongoItemReader
<
Contact
>
mongoItemReader
)
{
...
...
@@ -268,7 +268,7 @@ public class ContactsProcessingConfiguration {
@Value
(
"#{stepExecutionContext[start]}"
)
final
int
start
,
@Value
(
"#{stepExecutionContext[end]}"
)
final
int
end
)
{
log
.
info
(
"{} currently reading
registrations
from itemId collections from id={} - to id= {} "
,
name
,
start
,
end
);
log
.
info
(
"{} currently reading
Contact(s)
from itemId collections from id={} - to id= {} "
,
name
,
start
,
end
);
List
<
String
>
itemIdentifiers
=
(
List
<
String
>)
itemIdMappingService
.
getItemIdMappingsBetweenIds
(
start
,
end
);
...
...
@@ -288,7 +288,7 @@ public class ContactsProcessingConfiguration {
@Value
(
"#{stepExecutionContext[name]}"
)
final
String
name
,
@Value
(
"#{stepExecutionContext[start]}"
)
final
int
start
,
@Value
(
"#{stepExecutionContext[end]}"
)
final
int
end
)
{
log
.
info
(
"{} currently reading
registrations
from itemId collections from id={} - to id= {} "
,
name
,
start
,
end
);
log
.
info
(
"{} currently reading
Registration(s)
from itemId collections from id={} - to id= {} "
,
name
,
start
,
end
);
List
<
byte
[]>
itemIdentifiers
=
(
List
<
byte
[]>)
itemIdMappingService
.
getItemIdMappingsBetweenIds
(
start
,
end
);
...
...
@@ -308,7 +308,7 @@ public class ContactsProcessingConfiguration {
@Value
(
"#{stepExecutionContext[name]}"
)
final
String
name
,
@Value
(
"#{stepExecutionContext[start]}"
)
final
long
start
,
@Value
(
"#{stepExecutionContext[end]}"
)
final
long
end
)
{
log
.
info
(
"{} currently reading
registrations
from itemId collections from id={} - to id= {} "
,
name
,
start
,
end
);
log
.
info
(
"{} currently reading
Registration(s)
from itemId collections from id={} - to id= {} "
,
name
,
start
,
end
);
List
<
byte
[]>
itemIdentifiers
=
(
List
<
byte
[]>)
itemIdMappingService
.
getItemIdMappingsBetweenIds
(
start
,
end
);
...
...
robert-server-batch/src/main/java/fr/gouv/stopc/robert/server/batch/processor/PurgeOldEpochExpositionsProcessor.java
View file @
0f5a86d4
...
...
@@ -15,6 +15,7 @@ import fr.gouv.stopc.robertserver.database.model.Registration;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
@Slf4j
@AllArgsConstructor
public
class
PurgeOldEpochExpositionsProcessor
implements
ItemProcessor
<
Registration
,
Registration
>
{
...
...
robert-server-batch/src/test/java/test/fr/gouv/stopc/robertserver/batch/processor/ContactProcessorTest.java
View file @
0f5a86d4
...
...
@@ -60,8 +60,10 @@ import fr.gouv.stopc.robertserver.database.model.Registration;
import
fr.gouv.stopc.robertserver.database.service.ContactService
;
import
fr.gouv.stopc.robertserver.database.service.IRegistrationService
;
import
lombok.extern.slf4j.Slf4j
;
import
test.fr.gouv.stopc.robertserver.batch.utils.ProcessorTestUtils
;
@Slf4j
@DirtiesContext
(
classMode
=
ClassMode
.
AFTER_EACH_TEST_METHOD
)
@ExtendWith
(
SpringExtension
.
class
)
...
...
@@ -452,7 +454,6 @@ public class ContactProcessorTest {
System
.
arraycopy
(
ebid
,
0
,
helloMessage
,
encryptedCountryCode
.
length
,
ebid
.
length
);
System
.
arraycopy
(
time
,
0
,
helloMessage
,
encryptedCountryCode
.
length
+
ebid
.
length
,
time
.
length
);
doReturn
(
Optional
.
of
(
GetInfoFromHelloMessageResponse
.
newBuilder
()
.
setIdA
(
ByteString
.
copyFrom
(
this
.
registration
.
get
().
getPermanentIdentifier
()))
...
...
robert-server-batch/src/test/java/test/fr/gouv/stopc/robertserver/batch/processor/PurgeOldEpochExpositionsProcessorTest.java
View file @
0f5a86d4
...
...
@@ -18,6 +18,7 @@ import org.springframework.test.annotation.DirtiesContext;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.junit.jupiter.SpringExtension
;
import
test.fr.gouv.stopc.robertserver.batch.utils.ProcessorTestUtils
;
import
fr.gouv.stopc.robert.server.batch.RobertServerBatchApplication
;
import
fr.gouv.stopc.robert.server.batch.configuration.ContactsProcessingConfiguration
;
...
...
@@ -30,7 +31,6 @@ import fr.gouv.stopc.robertserver.database.model.EpochExposition;
import
fr.gouv.stopc.robertserver.database.model.Registration
;
import
fr.gouv.stopc.robertserver.database.service.IRegistrationService
;
import
test.fr.gouv.stopc.robertserver.batch.utils.ProcessorTestUtils
;
@DirtiesContext
(
classMode
=
DirtiesContext
.
ClassMode
.
AFTER_EACH_TEST_METHOD
)
@ExtendWith
(
SpringExtension
.
class
)
...
...
robert-server-batch/src/test/java/test/fr/gouv/stopc/robertserver/batch/processor/RegistrationProcessorTest.java
View file @
0f5a86d4
package
test.fr.gouv.stopc.robertserver.batch.processor
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertEquals
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertTrue
;
...
...
@@ -33,7 +32,6 @@ import fr.gouv.stopc.robert.server.common.utils.TimeUtils;
import
fr.gouv.stopc.robertserver.database.model.EpochExposition
;
import
fr.gouv.stopc.robertserver.database.model.Registration
;
import
fr.gouv.stopc.robertserver.database.service.IRegistrationService
;
import
test.fr.gouv.stopc.robertserver.batch.utils.ProcessorTestUtils
;
@DirtiesContext
(
classMode
=
DirtiesContext
.
ClassMode
.
AFTER_EACH_TEST_METHOD
)
...
...
robert-server-common/src/test/java/test/fr/gouv/stopc/robert/server/common/utils/TimeUtilsTest.java
View file @
0f5a86d4
...
...
@@ -4,8 +4,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertNotEquals
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertTrue
;
import
fr.gouv.stopc.robert.server.common.utils.TimeUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.jupiter.api.Test
;
import
java.time.LocalDate
;
...
...
@@ -14,6 +12,9 @@ import java.time.ZoneId;
import
java.time.ZonedDateTime
;
import
fr.gouv.stopc.robert.server.common.utils.TimeUtils
;
import
lombok.extern.slf4j.Slf4j
;
@Slf4j
public
class
TimeUtilsTest
{
...
...
robert-server-database/src/main/java/fr/gouv/stopc/robertserver/database/service/impl/ContactServiceImpl.java
View file @
0f5a86d4
...
...
@@ -12,6 +12,7 @@ import org.springframework.util.CollectionUtils;
import
fr.gouv.stopc.robertserver.database.model.Contact
;
import
fr.gouv.stopc.robertserver.database.repository.ContactRepository
;
import
fr.gouv.stopc.robertserver.database.service.ContactService
;
import
org.springframework.util.CollectionUtils
;
@Service
...
...
robert-server-database/src/main/java/fr/gouv/stopc/robertserver/database/service/impl/RegistrationService.java
View file @
0f5a86d4
...
...
@@ -42,14 +42,14 @@ public class RegistrationService implements IRegistrationService {
}
@Override
public
void
saveAll
(
final
List
<
Registration
>
registrations
)
{
public
void
saveAll
(
final
List
<
Registration
>
registrations
)
{
if
(!
CollectionUtils
.
isEmpty
(
registrations
))
{
this
.
registrationRepository
.
saveAll
(
registrations
);
}
}
if
(!
CollectionUtils
.
isEmpty
(
registrations
))
{
this
.
registrationRepository
.
saveAll
(
registrations
);
}
}
@Override
@Override
public
void
delete
(
Registration
registration
)
{
Optional
.
ofNullable
(
registration
).
ifPresent
(
this
.
registrationRepository
::
delete
);
}
...
...
@@ -64,53 +64,53 @@ public class RegistrationService implements IRegistrationService {
return
this
.
registrationRepository
.
findAll
();
}
/**
* {@inheritDoc}
*/
@Override
public
Long
countNbUsersAtRiskAgain
()
{
return
this
.
registrationRepository
.
countNbUsersAtRiskAgain
();
}
/**
* {@inheritDoc}
*/
@Override
public
Long
countNbUsersAtRiskAndNotNotified
()
{
return
this
.
registrationRepository
.
countNbUsersAtRiskAndNotNotified
();
}
/**
* {@inheritDoc}
*/
@Override
public
Long
countNbUsersNotified
()
{
return
this
.
registrationRepository
.
countNbUsersNotified
();
}
/**
* {@inheritDoc}
*/
@Override
public
Long
countNbExposedUsersButNotAtRisk
()
{
return
this
.
registrationRepository
.
countNbExposedUsersButNotAtRisk
();
}
/**
* {@inheritDoc}
*/
@Override
public
Long
countNbNotifiedUsersScoredAgain
()
{
return
this
.
registrationRepository
.
countNbNotifiedUsersScoredAgain
();
}
@Override
public
Long
count
()
{
return
this
.
registrationRepository
.
count
();
}
@Override
public
Long
countNbUsersWithOldEpochExpositions
(
int
minEpochId
)
{
return
this
.
registrationRepository
.
countNbUsersWithOldEpochExpositions
(
minEpochId
);
}
/**
* {@inheritDoc}
*/
@Override
public
Long
countNbUsersAtRiskAgain
()
{
return
this
.
registrationRepository
.
countNbUsersAtRiskAgain
();
}
/**
* {@inheritDoc}
*/
@Override
public
Long
countNbUsersAtRiskAndNotNotified
()
{
return
this
.
registrationRepository
.
countNbUsersAtRiskAndNotNotified
();
}
/**
* {@inheritDoc}
*/
@Override
public
Long
countNbUsersNotified
()
{
return
this
.
registrationRepository
.
countNbUsersNotified
();
}
/**
* {@inheritDoc}
*/
@Override
public
Long
countNbExposedUsersButNotAtRisk
()
{
return
this
.
registrationRepository
.
countNbExposedUsersButNotAtRisk
();
}
/**
* {@inheritDoc}
*/
@Override
public
Long
countNbNotifiedUsersScoredAgain
()
{
return
this
.
registrationRepository
.
countNbNotifiedUsersScoredAgain
();
}
@Override
public
Long
count
()
{
return
this
.
registrationRepository
.
count
();
}
@Override
public
Long
countNbUsersWithOldEpochExpositions
(
int
minEpochId
)
{
return
this
.
registrationRepository
.
countNbUsersWithOldEpochExpositions
(
minEpochId
);
}
}
robert-server-ws-rest/src/main/java/fr/gouv/stopc/robertserver/ws/service/impl/AuthRequestValidationServiceImpl.java
View file @
0f5a86d4
...
...
@@ -234,4 +234,5 @@ public class AuthRequestValidationServiceImpl implements AuthRequestValidationSe
}
return
Optional
.
empty
();
}
}
robert-server-ws-rest/src/test/java/test/fr/gouv/stopc/robertserver/ws/DeleteHistoryControllerWsRestTest.java
View file @
0f5a86d4
...
...
@@ -174,6 +174,7 @@ public class DeleteHistoryControllerWsRestTest {
}
/** Test the access for API V1, should not be used since API V2 */
@Test
public
void
testAccessV1
()
{
deleteHistoryWithExposedEpochsSucceeds
(
UriComponentsBuilder
.
fromUriString
(
this
.
pathPrefix_V1
).
path
(
UriConstants
.
DELETE_HISTORY
).
build
().
encode
().
toUri
());
...
...
robert-server-ws-rest/src/test/java/test/fr/gouv/stopc/robertserver/ws/RegisterControllerWsRestTest.java
View file @
0f5a86d4
...
...
@@ -169,7 +169,7 @@ public class RegisterControllerWsRestTest {
RegisterInternalVo
.
builder
().
captcha
(
"mycaptcha"
).
build
()
,
this
.
headers
),
String
.
class
).
getStatusCode
());
}
@Test
public
void
testCaptchaFailure
()
{
this
.
body
=
RegisterVo
.
builder
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment