summaryrefslogtreecommitdiffstats
path: root/catalog-be/src
AgeCommit message (Collapse)AuthorFilesLines
2020-06-01Plugin to customize prop. during Service creationandre.schmid3-21/+118
Creates an entry point to customize properties of a Service Component before its creation. Change-Id: I102a70b37eec498dd9c6df009c38da57d0e5b17f Issue-ID: SDC-3062 Signed-off-by: andre.schmid <andre.schmid@est.tech>
2020-05-28Fix interface types creationandre.schmid4-28/+196
Interface types creation logic was not interpreting some allowed TOSCA entries, that, when declared, were breaking the interface type creation. Every entry under the interface type was being considered as an interface operation, but it is possible to have "derived_from", "version", "metadata" and "description". Also it is not considering the Interface Type entries "inputs", "operations" and "notifications". Another thing is that TOSCA 1.3 changes the way operations should be declared, deprecating the previous way. Now there should be an entry "operations" with the operations entries under it, instead of having the operations entries direct under the interface type. The change allows both types, following the TOSCA rule: if operations entry is not present, then the deprecated way is considered. Change-Id: I13218bda60b29d19b9c5565cbfd63ae3250a78bf Issue-ID: SDC-3075 Signed-off-by: andre.schmid <andre.schmid@est.tech>
2020-05-28Entry points in ToscaExportHandler for plugin useandre.schmid1-2/+2
Open the access for two methods in ToscaExportHandler so they can be called in a CsarEntryGenerator plugin. Change-Id: I0ee1daab348c0fc85db56428369a5ec190cb0101 Issue-ID: SDC-3083 Signed-off-by: andre.schmid <andre.schmid@est.tech>
2020-05-28Extract artifact component belonging logicFrancis Toth5-119/+417
This commit extracts checkArtifactInComponent and checkArtifactInResourceInstance from ArtifactsBusinessLogic. Tests have been added along with a some utility functions designed to generate randomized test data. The former tests were deleted as they were not doing any assertions. Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I1b27c55d064cf4e9a40cd7b152e7ea6032a09276 Issue-ID: SDC-2961
2020-05-28Allow global types generationaribeiro6-31/+213
This change allows to configure which global type file will be added to the generated CSAR Issue-ID: SDC-3021 Change-Id: I83c0c3f317c4a4e5e8dbf22cb3dbd47e63562d3a Signed-off-by: aribeiro <anderson.ribeiro@est.tech>
2020-05-27Refactor CsarUtils::WriteArtifactDefinitionFrancis Toth2-68/+60
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: I167a05d8fbc2085a3e25eeb5bfd6b30f0e80462e Issue-ID: SDC-2812
2020-05-27Add ArtifactsBusinessLogic::fetchLatestComponentMetadataFrancis Toth1-43/+47
Signed-off-by: Francis Toth <francis.toth@yoppworks.com> Change-Id: Ibb8621a91551a2e4ffcac1145f85ed7983063d02 Issue-ID: SDC-2812
2020-05-27Work on unchecked Optional accessChris André1-21/+58
- extract code to static methods - throw an explicit exception now if element not found Issue-ID: SDC-2987 Signed-off-by: Chris Andre <chris.andre@yoppworks.com> Change-Id: I693bb53059b056235b567ac1f9f752a33512505a
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