@Test
public void testAgentConfigInvalidMaxFrequency() throws Exception {

  temporarySystemProperties.set(Configuration.Property.MAX_HEAP_DUMP_FREQUENCY.getQualifiedName())
      .to("12h");
  Agent.initAgent(null, logger);
  verify(logger).error(argThat(is("JavaMemoryAssistant cannot start")),
      argThat(allOf(isA(IllegalArgumentException.class),
          hasMessageThat(is("The value '12h' is invalid for the 'jma.max_frequency' "
              + "property: it must follow the Java pattern '(\\d+)/(\\d*)(ms|s|m|h)'")))));
  verifyNoMoreInteractions(logger);
}