RocMarshal commented on code in PR #18983:
URL: https://github.com/apache/flink/pull/18983#discussion_r865948556
##########
flink-yarn/src/test/java/org/apache/flink/yarn/TaskExecutorProcessSpecContainerResourcePriorityAdapterTest.java:
##########
@@ -206,40 +199,49 @@ public void testExternalResource() {
final Map<String, Long> resultExternalResources =
ResourceInformationReflector.INSTANCE.getExternalResources(resource);
- assertThat(resultExternalResources.size(), is(1));
- assertThat(
-
resultExternalResources.get(SUPPORTED_EXTERNAL_RESOURCE_CONFIG_KEY),
- is(SUPPORTED_EXTERNAL_RESOURCE_MAX));
+ assertThat(resultExternalResources).hasSize(1);
+
assertThat(resultExternalResources.get(SUPPORTED_EXTERNAL_RESOURCE_CONFIG_KEY))
+ .isEqualTo(SUPPORTED_EXTERNAL_RESOURCE_MAX);
}
- @Test(expected = IllegalStateException.class)
- public void testExternalResourceFailExceedMax() {
+ @Test
+ void testExternalResourceFailExceedMax() {
assumeTrue(isExternalResourceSupported());
-
- getAdapterWithExternalResources(
- SUPPORTED_EXTERNAL_RESOURCE_NAME,
SUPPORTED_EXTERNAL_RESOURCE_CONFIG_KEY)
- .getPriorityAndResource(
-
TASK_EXECUTOR_PROCESS_SPEC_WITH_EXTERNAL_RESOURCE_EXCEED_MAX);
+ assertThatThrownBy(
+ () ->
+ getAdapterWithExternalResources(
+
SUPPORTED_EXTERNAL_RESOURCE_NAME,
+
SUPPORTED_EXTERNAL_RESOURCE_CONFIG_KEY)
Review Comment:
@zentol Would you mind elaborating on your suggestions ? Thanks a lot.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]