Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from CaritasDeutschland/develop
Browse files Browse the repository at this point in the history
sync develop to staging
  • Loading branch information
PhilippFr authored Nov 28, 2022
2 parents 4ef8303 + bebd1cd commit 69cd423
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 3 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/dockerImage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
run: |
echo "DOCKER_REGISTRY=$(echo "${{ matrix.registry }}/${{ github.repository }}" | awk '{print tolower($0)}')" >> $GITHUB_ENV
echo "DOCKER_IMAGE=$(echo "${{ github.repository }}" | awk -F / '{print tolower($2)}')" >> $GITHUB_ENV
echo "REPO_NAME_WITHOUT_PREFIX"=$(echo "${{ github.repository }}" | sed "s/.*\///" | awk -F / '{print tolower($0)}') >> $GITHUB_ENV
echo CLEAN_REF=$(echo "${GITHUB_REF_NAME#refs/heads/}") >> $GITHUB_ENV
echo TYPE=$(echo -n "${GITHUB_REF_TYPE}") >> $GITHUB_ENV
echo TIME_STAMP=$(echo -n "${{ steps.time.outputs.time }}") >> $GITHUB_ENV
Expand Down Expand Up @@ -95,3 +96,12 @@ jobs:
echo "### Publish Docker image :x:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- It seems that something has gone wrong" >> $GITHUB_STEP_SUMMARY
- name: Run Trivy vulnerability image scanner
if: ${{ (matrix.registry == 'ghcr.io') }}
uses: aquasecurity/trivy-action@master
with:
image-ref: '${{ env.DOCKER_REGISTRY }}/${{ env.REPO_NAME_WITHOUT_PREFIX }}:${{ env.DOCKER_IMAGE_TAG }}'
format: 'table'
exit-code: '1'
vuln-type: 'os,library'
severity: 'CRITICAL'
30 changes: 30 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,31 @@
<version>${spring-security.version}</version>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.3.0</version>
</dependency>

<dependency>
<groupId>com.github.jknack</groupId>
<artifactId>handlebars</artifactId>
<version>4.3.1</version>
</dependency>

<dependency>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-build-api</artifactId>
<version>0.0.7</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- OpenApi/Swagger dependencies -->
<dependency>
<groupId>org.openapitools</groupId>
Expand Down Expand Up @@ -114,6 +139,11 @@
<artifactId>commons-lang3</artifactId>
<version>3.11</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.10.0</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ void subscribe_Should_subscribeUser() throws Exception {
var stompSession = performConnect(FIRST_VALID_USER);
final Subscription subscription = performSubscribe(stompSession);


assertThat(this.socketUserRegistry.retrieveAllUsers(), hasSize(1));
WebSocketUserSession registeredUser = this.socketUserRegistry.retrieveAllUsers().get(0);
await()
.atMost(MESSAGE_TIMEOUT, SECONDS)
.atMost(15, SECONDS)
.until(registeredUser::getSubscriptionId, notNullValue());

assertThat(registeredUser, notNullValue());
Expand All @@ -110,11 +111,11 @@ void subscribe_Should_subscribeUser() throws Exception {
assertThat(registeredUser.getSubscriptionId(), notNullValue());
assertThat(subscription.getSubscriptionHeaders().get("destination"),
contains(SUBSCRIPTION_ENDPOINT));
performDisconnect(stompSession);
}

@Test
void disconnect_Should_removeUserFromRegistry() throws Exception {

var stompSession = performConnect(FIRST_VALID_USER);

assertThat(this.socketUserRegistry.retrieveAllUsers(), hasSize(1));
Expand Down Expand Up @@ -187,7 +188,7 @@ void sendLiveEvent_Should_sendVideoDenyRequestMessageEventToUser_When_userIsSubs
.andExpect(status().isOk());

await()
.atMost(MESSAGE_TIMEOUT, SECONDS)
.atMost(15, SECONDS)
.until(receivedMessages::size, is(1));
var resultMessage = receivedMessages.iterator().next();
assertThat(resultMessage, notNullValue());
Expand Down

0 comments on commit 69cd423

Please sign in to comment.