Skip to content

Replace import from impl package #136

Description

@lisajulia

Replace import com.sap.cds.services.impl.environment.SimplePropertiesProvider; at https://github.com/cap-java/cds-ai/blob/main/cds-feature-ai-core/src/test/java/com/sap/cds/feature/aicore/core/AICoreServiceConfigurationTest.java#L11:
with a record, e.g.:

  private record SimplePropertiesProvider(CdsProperties properties) implements PropertiesProvider {

    @Override
    @SuppressWarnings("unchecked")
    public <T> T bindPropertyClass(String section, Class<T> clazz) {
      if ("cds".equals(section) && CdsProperties.class.equals(clazz)) {
        return (T) properties;
      }
      throw new UnsupportedOperationException("Only CdsProperties is supported");
    }

    @Override
    public String getProperty(String key, String defaultValue) {
      return defaultValue;
    }

    @Override
    public <T> T getProperty(String key, Class<T> asClazz, T defaultValue) {
      return defaultValue;
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions