public static CreateSourceProperties from(final Map<String, Literal> literals) {
    try {
      return new CreateSourceProperties(literals, DurationParser::parse, false);
    } catch (final ConfigException e) {
      final String message = e.getMessage().replace(
          "configuration",
          "property"
      );

      throw new KsqlException(message, e);
    }
  }
@Test
  public void shouldThrowOnSessionWindowWithSize() {
    // When:
    final Exception e = assertThrows(
        KsqlException.class,
        () -> CreateSourceProperties.from(
            ImmutableMap.<String, Literal>builder()
                .putAll(MINIMUM_VALID_PROPS)
                .put(WINDOW_TYPE_PROPERTY, new StringLiteral("SESSION"))
                .put(WINDOW_SIZE_PROPERTY, new StringLiteral("2 MILLISECONDS"))
                .build())
    );

    // Then:
    assertThat(e.getMessage(), containsString("'WINDOW_SIZE' should not be set for SESSION windows."));
  }