From f044d42cc4a100c7ff75ae613876e06ec3bc0625 Mon Sep 17 00:00:00 2001 From: Sumanth K B Date: Wed, 18 Oct 2023 16:13:34 +0530 Subject: [PATCH] UT Changes --- .../NPM/ComponentCreatorInitial.cs | 20 ++++++++++++++----- .../NPM/ComponentCreatorTestMode.cs | 2 +- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/SW360IntegrationTest/NPM/ComponentCreatorInitial.cs b/src/SW360IntegrationTest/NPM/ComponentCreatorInitial.cs index d049d8b3..f63e7e11 100644 --- a/src/SW360IntegrationTest/NPM/ComponentCreatorInitial.cs +++ b/src/SW360IntegrationTest/NPM/ComponentCreatorInitial.cs @@ -163,11 +163,21 @@ public async Task TestReleaseCreation_ClearingStateAsNewClearing() string externalid = responseDataForRelease.ExternalIds.Package_Url; //Assert - Assert.AreEqual(expectedname, name, "Test Project Name"); - Assert.AreEqual(expectedversion, version, "Test Project Version"); - Assert.AreEqual(expecteddownloadurl, downloadurl, "Test download Url of rxjs"); - Assert.AreEqual(expectedexternalid, externalid, "Test component external id"); - Assert.AreEqual(expectedclearingState, clearingState); + if (responseData.Embedded.Sw360Releases.Count > 0) + { + //In Case Multiple Releases found just checking for Name & other details. + Assert.AreEqual(expectedname, name, "Test Project Name"); + Assert.AreEqual(expecteddownloadurl, downloadurl, "Test download Url of rxjs"); + Assert.AreEqual(expectedclearingState, clearingState); + } + else + { + Assert.AreEqual(expectedname, name, "Test Project Name"); + Assert.AreEqual(expectedversion, version, "Test Project Version"); + Assert.AreEqual(expecteddownloadurl, downloadurl, "Test download Url of rxjs"); + Assert.AreEqual(expectedexternalid, externalid, "Test component external id"); + Assert.AreEqual(expectedclearingState, clearingState); + } } diff --git a/src/SW360IntegrationTest/NPM/ComponentCreatorTestMode.cs b/src/SW360IntegrationTest/NPM/ComponentCreatorTestMode.cs index 86a18dfa..53a4fec0 100644 --- a/src/SW360IntegrationTest/NPM/ComponentCreatorTestMode.cs +++ b/src/SW360IntegrationTest/NPM/ComponentCreatorTestMode.cs @@ -120,7 +120,7 @@ public async Task TestComponentCreation_TestMode() new AuthenticationHeaderValue(TestConstant.TestSw360TokenType, TestConstant.TestSw360TokenValue); //url formation for retrieving component details - string url = TestConstant.Sw360ComponentApi + TestConstant.componentNameUrl + "rxjs"; + string url = TestConstant.Sw360ComponentApi + TestConstant.componentNameUrl + "typescript"; string responseBody = await httpClient.GetStringAsync(url); //GET request var responseData = JsonConvert.DeserializeObject(responseBody); //Assert