- @Override
- protected Map<String, String> makeEnrichment() {
- return Map.of(BandwidthOnDemandOperation.SERVICE_ID_KEY, "my-service", BandwidthOnDemandOperation.VNF_ID,
- "my-vnf");
+ @Test
+ public void testMakeRequestMissingBandwidthChangeTime() throws Exception {
+ oper = new BandwidthOnDemandOperation(params, config);
+ oper.setProperty(OperationProperties.ENRICHMENT_SERVICE_ID, MY_SERVICE);
+ oper.setProperty(OperationProperties.ENRICHMENT_BANDWIDTH, MY_BANDWIDTH);
+ oper.setProperty(OperationProperties.ENRICHMENT_VNF_ID, MY_VNF);
+
+ oper.generateSubRequestId(1);
+ outcome.setSubRequestId(oper.getSubRequestId());
+
+ assertThatIllegalStateException().isThrownBy(() -> oper.makeRequest(1))
+ .withMessageContaining("missing bandwidth change time from enrichment data");
+ }
+
+ @Test
+ public void testMakeRequestMissingVnfId() throws Exception {
+ oper = new BandwidthOnDemandOperation(params, config);
+ oper.setProperty(OperationProperties.ENRICHMENT_SERVICE_ID, MY_SERVICE);
+ oper.setProperty(OperationProperties.ENRICHMENT_BANDWIDTH, MY_BANDWIDTH);
+ oper.setProperty(OperationProperties.ENRICHMENT_BANDWIDTH_CHANGE_TIME, MY_CHANGE_TIME);
+
+ oper.generateSubRequestId(1);
+ outcome.setSubRequestId(oper.getSubRequestId());
+
+ assertThatIllegalStateException().isThrownBy(() -> oper.makeRequest(1))
+ .withMessageContaining("missing VNF id from enrichment data");