summaryrefslogtreecommitdiffstats
path: root/catalog-be/src
AgeCommit message (Collapse)AuthorFilesLines
2020-05-26Fix for locked componentaribeiro2-13/+22
After add, update or remove node_filter the component was left locked on SDC Issue-ID: SDC-3072 Change-Id: I27058760704bd6261619946becda3612a6386432 Signed-off-by: aribeiro <anderson.ribeiro@est.tech>
2020-05-25Refactor CsarUtil::addInnerComponentsToCSARFrancis Toth1-20/+36
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I7f32d729a96f696c217631cd019105c17cb36a8c Issue-ID: SDC-2812
2020-05-24500 error at WFD artifact-deliveries apiBen David, Elad (eb7504)1-3/+4
Change-Id: I9227387c26b6ee4c68c635b78c4980a9c07b3d35 Issue-ID: SDC-3052 Signed-off-by: Ben David, Elad (eb7504) <eb7504@intl.att.com>
2020-05-21Refactor ArtifactsBusinessLogic::getRelatedComponentInstanceFrancis Toth1-51/+49
This commit aims to refactor the ArtifactsBusinessLogic::getRelatedComponentInstance, and getRelatedComponentComponentInstance. It improves how Either is used, fixes a potential NullPointerException, reduces some duplication along with cyclomatic complexity. Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I2503f5e2a697f793e4dcf32d7793f83c4a25ff46 Issue-ID: SDC-2812
2020-05-20Remove wildcard pattern when retrieving componentsFrancis Toth3-40/+71
This commit aims to remove a redundant cast while preparing the field for some Either refactoring in ArtifactsBusinessLogic. The reasons for removing the wildcard pattern are explained in SDC-3040 (a sub-task of SDC-2812). Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I573c01eca56f096ccb54e564d0144291121bde22 Issue-ID: SDC-2812
2020-05-20Refactor ArtifactsBusinessLogic::handleDeleteInternalFrancis Toth1-18/+42
This commit is a first step towards the ArtifactsBusinessLogic::handleDeleteInternal function refactoring. It aims to improve how Either is used, and to reduce its cyclomatic complexity along with some duplications. Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I1b476ccc0e0341975b80c10dc79c5dc1592267f4 Issue-ID: SDC-2812
2020-05-19Add null test to ComponentInstanceBusinessLogicChris André1-55/+81
- Added test in `changeInstanceVersion` for null value Issue-ID: SDC-2908 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I42a428c4b245a55b7229e2ec9b781e9af4403662
2020-05-19Refactor ArtifactsBusinessLogic::generateAndSaveToscaArtifactFrancis Toth1-34/+30
This commit aims to make some minor refactoring related to the either used in ArtifactsBusinessLogic::generateAndSaveToscaArtifact. Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I4923e014146a17f1cd035db3513359a2ab8f38f2 Issue-ID: SDC-2812
2020-05-18Refactor CsarUtil::extractVfcArtifactFrancis Toth2-38/+58
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: Ica8d17d4f3c763920f406ccb89fb3e464d05eab4 Issue-ID: SDC-2812
2020-05-18Refactor tosca representation retrieval in CsarUtils::populateZipFrancis Toth1-30/+56
This commit aims to simplify CsarUtils::populateZip by extracting how a tosca representation is fetched to another function. this enables to reduce the overall cyclomatic complexity of the function. Some additional work still needs to be done especially regarding the ToscaRepresentation and MainYamlWithDependencies classes (These happen to be really similar). This will be done in another change in the near future. Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I93600d0752565de523cf2285b1fa2ba43a96334f Issue-ID: SDC-2812
2020-05-12Remove unused ArtifactsBusinessLogic::updateArtifactsFlowForInterfaceOperationsFrancis Toth1-63/+0
This commit deletes the ArtifactsBusinessLogic::updateArtifactsFlowForInterfaceOperations function as it is no longer used anywhere. Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I1dd950930485fc83bb02c889dafc5461192accbc Issue-ID: SDC-2812
2020-05-11Refactor CsarUtil::writeComponentInterfaceFrancis Toth1-18/+22
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I6a40119540c18469db44e218984b4d4b92d3f4af Issue-ID: SDC-2812
2020-05-11Refactor ArtifactsBusinessLogic::generateToscaArtifactFrancis Toth1-35/+55
This commit aims to refactor how Either is used in ArtifactsBusinessLogic::generateToscaArtifact. In order to keep the refactoring relatively small, we evalute its result at the call site. Change-Id: I669b30b44e9c69d1b3968fd719c5340b2dff83f5 Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Issue-ID: SDC-2812
2020-05-10Refactor to remove false positives from SonarChris André2-47/+111
- change `updateResourceInstancesNames` to account for case where `preparedResource` is null - change `findInputByName` to return an Either<InputDefinition, RuntimeException> in order to make exceptions explicit - create `rollbackWithEither` (+ tests) to make exceptions more explicit Issue-ID: SDC-2992 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I487994a3f9e88b0a2b14d2679c3587d85d8aa12d
2020-05-10Refactor ArtifactsBusinessLogic::handleDelete and ↵Francis Toth6-63/+53
ArtifactsBusinessLogic::deleteArtifactByInterface Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I89f12c70f388375ed13554edf62bf6a442c9036a Issue-ID: SDC-2812
2020-05-10Moved ArtifactsBusinessLogic::buildJsonStringForCsarVfcArtifact to JsonUtilsFrancis Toth4-28/+125
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: Ia3bb9fe9f97e1759e4e5b70eb5e5396ed87d716d Issue-ID: SDC-2961
2020-05-08Refactor CsarUtil::addComponentToCacheFrancis Toth1-17/+40
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: Ib78be78780a97c873e710d805dd26273159d5354 Issue-ID: SDC-2812
2020-05-07Support functions in TOSCA Simple Profile in YAMLvasraz9-10/+9
This commit aim to generalize usage of ToscaFunctions enum Change-Id: Iab3529e101f75db5f856778334a852afb532cdb6 Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Issue-ID: SDC-2982
2020-05-06Prepare for Junit5vasraz8-55/+103
Remove unused/duplicated dependencies Change-Id: Iee0d9510ffbe3e2e14574e22ba965d6829fd568b Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Issue-ID: SDC-2844 Issue-ID: SDC-2983
2020-05-06fix bug - Error 500 while adding an OperationYuli Shlosberg1-5/+0
Change-Id: I7def95b3688877acbc9332cf4174c9d92226f2e2 Issue-ID: SDC-2953 Signed-off-by: Yuli Shlosberg <ys9693@att.com>
2020-05-06fix bug - Unable to link CSAR artifactYuli Shlosberg2-5/+13
Change-Id: I586637f988b84b3b858e2c8d567c6844be38322b Issue-ID: SDC-2972 Signed-off-by: Yuli Shlosberg <ys9693@att.com>
2020-05-06Handle null case in `addCalculatedCapabilitiesWithPropertiesToComponent`Chris André1-6/+15
- Change code to handle a null value for `groupDefinitions` as if it was an empty List Issue-ID: SDC-2910 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I5fca0ab76886e5f6a73a8f05ec35d38848f96dd8
2020-05-05Add tests for the presence of Optional valuesChris André1-14/+24
Issue-ID: SDC-3012 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I56cbf7fb5bd04ad2fbc496231d6abe72066124fe
2020-05-05Remove call to `get` on Optional variablesChris André1-12/+21
- Made multiple variables Optional Issue-ID: SDC-2991 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: If3dbfd37e933d10698ad1a93b6762c84e30f69b8
2020-05-05Refactor CsarUtil::getLatestSchemaFilesFromCassandraFrancis Toth1-16/+31
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I3f96d76a07fd32bdbd8b59beb5409eab0b0f3aa8 Issue-ID: SDC-2812
2020-05-05Refactor CsarUtil::getFromCassandraFrancis Toth1-11/+6
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I510d1d7fb4f4a7d7152fd5ea6d4d5ff61deea23a Issue-ID: SDC-2812
2020-05-05Refactor CsarUtils::collectComponentTypeArtifactsFrancis Toth1-14/+22
This commit is a minor refactoring required to refactor CsarUtils::collectComponentInstanceArtifacts. In order to keep this commit small, we only focused CsarUtils::collectComponentTypeArtifacts, and removed any output that is not reflected by the function's result type. Modifying an argument is a actually a bad practice as explained in Clean Code by Robert Martin (cf. "Output arguments should be avoided"). This commit aims to enforce this aspect. Change-Id: Ice4d6c9a78e7706c639dd60bc272253e298bc7be Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Issue-ID: SDC-2812
2020-05-03Refactor CsarUtils::createCsarFrancis Toth1-7/+6
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I41994c98515844030eed1d6f2756c9779e864cff Issue-ID: SDC-2812
2020-05-03Extract ArtifactOperationInfo from ArtifactsBusinessLogicFrancis Toth13-99/+150
This commit only intends to extract the inner static class ArtifactOperationInfo from the ArtifactsBusinessLogic class. In addition, getters have been added to get the artifactOperationEnum field's state (this allowed to reduce some boilerplate). Change-Id: Ib79a75893ef11ba0d25e0578d7e95f60284589d0 Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Issue-ID: SDC-2961
2020-05-03Refactor CsarUtils::validateNonMetaArtifactFrancis Toth1-20/+22
This commit aims to refactor the CsarUtils::validateNonMetaArtifact function and make it up to standards regarding how fj.Either should be used. Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: Icadfce7229839e53bd09926b6865f2872c39d1a5 Issue-ID: SDC-2812
2020-04-30Replace call to `get` with a call to `ifPresent`Chris André1-3/+6
Issue-ID: SDC-2989 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I7fe273d869035f8852dbc398de60cc49dec2ce6e
2020-04-28Handle null case in `GroupVersionUpdater`Chris André2-13/+330
- change in the final condition of `isGenerateGroupUUID` - Added tests related to modified code Issue-ID: SDC-2913 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I22738f9f4922467209a16a4d6b3b78d7bfac11c9
2020-04-28Refactor CsarUtils::getEntryDataFrancis Toth1-20/+18
Change-Id: I1732ae05cfbe93c1bef8c249e16088a0cad34106 Issue-ID: SDC-2812 Signed-off-by: Francis Toth <francis.toth@yoppworks.com>
2020-04-28Refactor CsarUtils::populateZipFrancis Toth1-30/+55
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I136ebda0ff92d6c42368f102ccf2b10f37524808 Issue-ID: SDC-2812
2020-04-27Add null test to ComponentBusinessLogicChris André1-13/+14
- Added test in `getFilteredComponentInstanceProperties` for null value - Removed nested `if` statements in `isMatchingComplexPropertyByRecursively` Issue-ID: SDC-2907 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I13a47b0dfe7aa6dec845a856c58bba8be5c1eead
2020-04-26Fix potential NPE in ArtifactsBusinessLogicandre.schmid1-8/+15
Fixes potential NPE in ArtifactsBusinessLogic introduced by SDC-2754. Change-Id: If53915ffc41ddd0dbcf00ea318cdae6f1b5471ad Issue-ID: SDC-2959 Signed-off-by: andre.schmid <andre.schmid@est.tech>
2020-04-23Minor cleanups for BasicAuthenticationFilterChris André1-17/+17
- Changed String representing encoding to Java's StandardCharsets.UTF_8 - Added explicit else condition in order to not rely on `abortWith`'s side effects Issue-ID: SDC-2917 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I81cb94c399ff1d810e85c7b63fde195928ab1b08
2020-04-23Add null testsChris André1-15/+16
- Change `isPropertiesListSizesNotEquals` to `isPropertiesListSizesEquals` - Added assertions to silence SonarCloud Issue-ID: SDC-2914 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I88003de54aea6c28575fecf0f41b4c5ef36ef154
2020-04-23Fix null pointer exception warningsRodrigo Lima1-33/+48
Issue-ID: SDC-2911 Signed-off-by: Rodrigo Lima <rodrigo.lima@yoppworks.com> Change-Id: Ic7f0ef631ed98e8baf2ea32b6bfc56a7142738f8
2020-04-22Fix unit tests not runningBaumel, Dvir (db384r)1-7/+0
Change-Id: I06462b6180a1f1a310aae994f4e703a498f80247 Issue-ID: SDC-2933 Signed-off-by: Baumel, Dvir (db384r) <dvir.baumel@intl.att.com>
2020-04-22Used `configurationManager` instead of `getConfigurationManager`Chris André1-10/+9
Issue-ID: SDC-2890 Change-Id: I1559ebc60076bd0884ae1136c9c904f7ab46e72e Signed-off-by: Chris Andre <chris.andre@yoppworks.com>
2020-04-22Fix bug for class SwitchoverDetectorReo Inoue1-1/+1
Signed-off-by: Reo Inoue <inoue.reo@jp.fujitsu.com> Issue-ID: SDC-2931 Change-Id: I6b40f538ff9ce7eed22ce71c542b188a8c866f26
2020-04-22Add null test to DistributionMonitoringBusinessLogicChris André1-3/+12
- Added test in `handleAuditingDaoResponse` for null value related to `resAuditingGenericEvent` Issue-ID: SDC-2909 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I422629cdbd4f05e10609cd78b7328c4e9f45538b
2020-04-22Handle null condition in ResourceImportManagerRodrigo Lima1-6/+7
- check if parentResource null in methods setRequirements and setCapabilities Issue-ID: SDC-2912 Signed-off-by: Rodrigo Lima <rodrigo.lima@yoppworks.com> Change-Id: I1ea5a8cf26e3883b5d26fb970bc0abc4cbf1ee9a
2020-04-22Add null test to test in `UpgradeBusinessLogic`Chris André1-2/+2
Issue-ID: SDC-2915 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I4e6f27b707b1bdbbecf9a97606c9a655d834fe56
2020-04-22Add null tests in `createComponentExternal`Chris André1-3/+3
Issue-ID: SDC-2916 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: Ieb0a79c8d3a891a08cd758e1a4ebab7679166476
2020-04-20Fix Tosca properties declarationaribeiro3-6/+4
Remove duplicated entries Default value for Boolean type should not be a String According to the description for the keyname 'attachments:' it should be of type List rather than String Issue-ID: SDC-2870 Signed-off-by: aribeiro <anderson.ribeiro@est.tech> Change-Id: Iac2b4f89dac16a6aef9dcabea74def5cacff99a6
2020-04-19Validates artifact configurationandre.schmid1-0/+43
Validates if all the SDC base artifacts are configured. The base artifacts are provided by the ArtifactTypeEnum. Change-Id: Iffa38d6ba276014940afad71f7472bc8d730fcf8 Issue-ID: SDC-2929 Signed-off-by: andre.schmid <andre.schmid@est.tech>
2020-04-19Configure a new Artifact Typeandre.schmid26-1911/+1452
Centralizes artifact configuration in one yaml entry. Allow the configuration of a new artifact type without the need of code changes. The configuration file now is used as a source of artifacts types instead the artifact type enum. The enum will be used as a source of base artifact types and also in hard coded business rules. Change-Id: Id0383d9fca9bce0519a4d52a4ecb3a68c8713f0f Issue-ID: SDC-2754 Signed-off-by: andre.schmid <andre.schmid@est.tech>
2020-04-19Fix GAB problem in ui-ci testsandre.schmid1-0/+2
Generic Artifact Browser is failing in tests due mainly to a removal of the default constructor in GAB class. Change-Id: Id10b8d8d81c224e2658002b9c928e8aef7ca8e32 Issue-ID: SDC-2903 Signed-off-by: andre.schmid <andre.schmid@est.tech>