com.intershop.oms.test.configuration.Configuration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iom-test-framework Show documentation
Show all versions of iom-test-framework Show documentation
An "SDK"-style library improving test automation for Intershop Order Management.
package com.intershop.oms.test.configuration;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;
import io.smallrye.config.WithName;
import java.util.Map;
import java.util.Optional;
@ConfigMapping(prefix = "testframework")
public interface Configuration {
@WithName("default-endpoint")
Optional defaultEndpoint();
@WithName("database")
Map databaseConfigs();
@WithName("order-service")
Map orderServiceConfigs();
@WithName("order-state-service")
Map orderStateServiceConfigs();
@WithName("inventory-service")
Map inventoryServiceConfigs();
@WithName("rma-service")
Map rmaServiceConfigs();
@WithName("schedule-service")
Map scheduleServiceConfigs();
@WithName("supplier-service")
Map supplierServiceConfigs();
@WithName("transmission-service")
Map transmissionServiceConfigs();
@WithName("client-logging")
@WithDefault("true")
boolean clientLogging();
@WithName("jwt-secret")
Optional jwtSecret();
default ServiceConfiguration getDbServiceById(String id) {
return Optional.ofNullable(databaseConfigs().get(id)).orElseThrow(() -> new IllegalArgumentException("db service config with name " + id + " not found!"));
}
default ServiceConfiguration getOrderServiceById(String id) {
return Optional.ofNullable(orderServiceConfigs().get(id)).orElseThrow(() -> new IllegalArgumentException("order service config with name " + id + " not found!"));
}
default ServiceConfiguration getInventoryServiceById(String id) {
return Optional.ofNullable(inventoryServiceConfigs().get(id)).orElseThrow(() -> new IllegalArgumentException("inventory service config with name " + id + " not found!"));
}
default ServiceConfiguration getOrderStateServiceById(String id) {
return Optional.ofNullable(orderStateServiceConfigs().get(id)).orElseThrow(() -> new IllegalArgumentException("order state service config with name " + id + " not found!"));
}
default ServiceConfiguration getRMAServiceById(String id) {
return Optional.ofNullable(rmaServiceConfigs().get(id)).orElseThrow(() -> new IllegalArgumentException("RMA service config with name " + id + " not found!"));
}
default ServiceConfiguration getScheduleServiceById(String id) {
return Optional.ofNullable(scheduleServiceConfigs().get(id)).orElseThrow(() -> new IllegalArgumentException("schedule service config with name " + id + " not found!"));
}
default ServiceConfiguration getSupplierServiceById(String id) {
return Optional.ofNullable(supplierServiceConfigs().get(id)).orElseThrow(() -> new IllegalArgumentException("supplier service config with name " + id + " not found!"));
}
default ServiceConfiguration getTransmissionServiceById(String id) {
return Optional.ofNullable(transmissionServiceConfigs().get(id)).orElseThrow(() -> new IllegalArgumentException("transmission service config with name " + id + " not found!"));
}
}