+ /*
+ * Tests makeRequest() when a property is missing.
+ */
+
+ @Test
+ public void testMakeRequestMissingBandwidth() throws Exception {
+ oper = new BandwidthOnDemandOperation(params, config);
+ oper.setProperty(OperationProperties.ENRICHMENT_SERVICE_ID, MY_SERVICE);
+ oper.setProperty(OperationProperties.ENRICHMENT_BANDWIDTH_CHANGE_TIME, MY_CHANGE_TIME);
+ oper.setProperty(OperationProperties.ENRICHMENT_VNF_ID, MY_VNF);
+
+ oper.generateSubRequestId(1);
+ outcome.setSubRequestId(oper.getSubRequestId());
+
+ assertThatIllegalStateException().isThrownBy(() -> oper.makeRequest(1))
+ .withMessageContaining("missing bandwidth from enrichment data");
+ }
+
+ @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");