diff --git a/src/main/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/service/impl/ConfigSRV.java b/src/main/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/service/impl/ConfigSRV.java index b8a08d0..1f9b5ca 100644 --- a/src/main/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/service/impl/ConfigSRV.java +++ b/src/main/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/service/impl/ConfigSRV.java @@ -28,7 +28,7 @@ import java.util.Map; import static it.finanze.sanita.fse2.ms.gtw.statusmanager.client.routes.base.ClientRoutes.Config.*; -import static it.finanze.sanita.fse2.ms.gtw.statusmanager.dto.ConfigItemDTO.*; +import static it.finanze.sanita.fse2.ms.gtw.statusmanager.dto.ConfigItemDTO.ConfigDataItemDTO; import static it.finanze.sanita.fse2.ms.gtw.statusmanager.enums.ConfigItemTypeEnum.STATUS_MANAGER; @Slf4j @@ -59,6 +59,7 @@ void initialize() { }); } } + integrity(); } @Override @@ -111,4 +112,16 @@ private void refresh(ConfigItemTypeEnum type, String name) { String prop = client.getProps(type, name, previous); props.put(name, Pair.of(new Date().getTime(), prop)); } + + private void integrity() { + String err = "Missing props {} from status-manager"; + String[] out = new String[]{ + PROPS_NAME_EXP_DAYS, + PROPS_NAME_SUBJECT, + PROPS_NAME_ISSUER_CF + }; + for (String prop : out) { + if(!props.containsKey(prop)) throw new IllegalStateException(err.replace("{}", prop)); + } + } }