Skip to content

Commit

Permalink
Merge branch 'develop' into 3898-add-job-tracking-metadata-to-compact…
Browse files Browse the repository at this point in the history
…ion-commit-transaction
  • Loading branch information
rtjd6554 authored Dec 17, 2024
2 parents c28703e + 24428f5 commit 39b2f49
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
49 changes: 49 additions & 0 deletions java/core/src/test/java/sleeper/core/deploy/SQSQueuesTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright 2022-2024 Crown Copyright
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package sleeper.core.deploy;

import org.junit.jupiter.api.Test;

import sleeper.core.properties.instance.CdkDefinedInstanceProperty;

import java.util.ArrayList;
import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;

public class SQSQueuesTest {

@Test
void shouldValidateThatAllTheQueuePropertiesArePartOfTheListDefinitions() throws Exception {
assertThat(SqsQueues.QUEUE_URL_PROPERTIES).containsAll(findAllPropertiesWithNamePart("queue.url"));
}

@Test
void shouldValidateThatAllTheDeadLetterQueuePropertiesArePartOfTheListDefinitions() throws Exception {
assertThat(SqsQueues.DEAD_LETTER_QUEUE_URL_PROPERTIES).containsAll(findAllPropertiesWithNamePart("dlq.url"));
}

private List<CdkDefinedInstanceProperty> findAllPropertiesWithNamePart(String namePart) throws Exception {
List<CdkDefinedInstanceProperty> outList = new ArrayList<CdkDefinedInstanceProperty>();

CdkDefinedInstanceProperty.getAll().stream().forEach(property -> {
if (property.getPropertyName().contains(namePart)) {
outList.add(property);
}
});
return outList;
}
}
2 changes: 1 addition & 1 deletion java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
<scijava.native.version>2.5.0</scijava.native.version>
<!-- Testing -->
<junit.version>5.11.4</junit.version>
<junit.platform.version>1.11.3</junit.platform.version>
<junit.platform.version>1.11.4</junit.platform.version>
<mockito.version>5.14.2</mockito.version>
<testcontainers.version>1.20.4</testcontainers.version>
<wiremock.version>2.35.2</wiremock.version>
Expand Down

0 comments on commit 39b2f49

Please sign in to comment.