return true;
}
- if (artifacts.size() < artifactsUuid.size()) {
+ if ((artifactsUuid != null) && (artifacts.size() < artifactsUuid.size())) {
log.info(" artifacts.size() < artifactsUuid.size() group {} in resource {} ", gr.getName(), resourceName);
return true;
}
gr.getName(), resourceName);
return true;
}
- if (artifactsUuid.contains(null)) {
+ if (artifactsUuid != null && artifactsUuid.contains(null)) {
log.info(" artifactsUuid.contains(null) group {} in resource {} ", gr.getName(), resourceName);
return true;
}
artifactlabel, artifactId, gr.getName(), resourceName);
return true;
}
- if (!artifactsUuid.contains(artifactDefinition.getArtifactUUID())) {
+ if (artifactsUuid != null && !artifactsUuid.contains(artifactDefinition.getArtifactUUID())) {
log.info(
" artifactsUuid.contains(artifactDefinition.getArtifactUUID() label {} group {} in resource {} ",
artifactlabel, gr.getName(), resourceName);
instArtifatIdSet.addAll(instArtifactsId);
}
- if (artifacts.size() < artifactsUuid.size()) {
+ if ((artifactsUuid != null) && (artifacts.size() < artifactsUuid.size())) {
log.info(" artifacts.size() < artifactsUuid.size() inst {} in service {} ", instName, servicename);
return true;
}
instName, servicename);
return true;
}
- if (artifactsUuid.contains(null)) {
+ if (artifactsUuid != null && artifactsUuid.contains(null)) {
log.info(" artifactsUuid.contains(null) inst {} in service {} ", instName, servicename);
return true;
}
artifactlabel, artifactId, instName, servicename);
return true;
}
- if (!artifactsUuid.contains(artifactDefinition.getArtifactUUID())) {
+ if (artifactsUuid != null && !artifactsUuid.contains(artifactDefinition.getArtifactUUID())) {
log.info(
" artifactsUuid.contains(artifactDefinition.getArtifactUUID() label {} inst {} in service {} ",
artifactlabel, instName, servicename);
return true;
}
}
- if(vfModule != null ){
+ if(vfModule != null && artifactsUuid != null){
return isProblematicVFModule(vfModule, artifactsUuid, instArtifactsUuid);
}
writer.flush();
}
} catch (IOException e) {
- log.error(e.getMessage());
+ log.error(e.getMessage());
} finally {
titanDao.commit();
}
}
} catch (IOException e) {
- log.error(e.getMessage());
+ log.error(e.getMessage());
}
}
package org.openecomp.sdc.asdctool.impl;
+import static org.junit.Assert.assertFalse;
import org.junit.Test;
public class ProductLogicTest {
return new ProductLogic();
}
- @Test(expected=NullPointerException.class)
+ @Test
public void testDeleteAllProducts() throws Exception {
ProductLogic testSubject;
String titanFile = "";
// default test
testSubject = createTestSubject();
result = testSubject.deleteAllProducts(titanFile, beHost, bePort, adminUser);
+ assertFalse(result);
}
-}
\ No newline at end of file
+}