diff options
author | KrupaNagabhushan <krupa.nagabhushan@est.tech> | 2020-08-10 18:42:48 +0100 |
---|---|---|
committer | Vasyl Razinkov <vasyl.razinkov@est.tech> | 2020-08-10 18:08:46 +0000 |
commit | 7212e92fbe010ccf7a057153406d0633a293a8fd (patch) | |
tree | 057f942028af1093c6fd53714c616feb3c424cbd /gui-editors/gui-editor-apex/src/test/java | |
parent | 864811238d7d44933df2c4f59f31947a83310587 (diff) |
Passing userId to upload policy
Issue-ID: POLICY-2751
Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech>
Change-Id: Ifc91bba369161a63f2ad759dcdc014bb12837e88
Diffstat (limited to 'gui-editors/gui-editor-apex/src/test/java')
-rw-r--r-- | gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/PolicyUploadHandlerTest.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/PolicyUploadHandlerTest.java b/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/PolicyUploadHandlerTest.java index 7a6ead7..6ec5eef 100644 --- a/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/PolicyUploadHandlerTest.java +++ b/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/converter/tosca/PolicyUploadHandlerTest.java @@ -52,6 +52,7 @@ import org.onap.policy.gui.editors.apex.rest.handling.plugin.upload.UploadPolicy public class PolicyUploadHandlerTest { + private static final String USER_ID = "cs0008"; @Mock private PolicyToscaConverter policyToscaConverter; @Mock @@ -87,7 +88,7 @@ public class PolicyUploadHandlerTest { .thenReturn(Response.ok().status(201).build()); ApexApiResult apexApiResult = policyUploadHandler - .doUpload(apexModel, mock(InputStream.class), mock(InputStream.class)); + .doUpload(apexModel, mock(InputStream.class), mock(InputStream.class), USER_ID); assertThat("Response should be ok", apexApiResult.isOk(), is(true)); String expectedSuccessMsg = @@ -99,7 +100,7 @@ public class PolicyUploadHandlerTest { .thenReturn(Response.serverError().build()); apexApiResult = policyUploadHandler - .doUpload(apexModel, mock(InputStream.class), mock(InputStream.class)); + .doUpload(apexModel, mock(InputStream.class), mock(InputStream.class), USER_ID); assertThat("Response should not be ok", apexApiResult.isNok(), is(true)); expectedSuccessMsg = @@ -118,7 +119,7 @@ public class PolicyUploadHandlerTest { when(toscaTemplateProcessor.process(any(InputStream.class))).thenReturn(processedToscaTemplate); when(apexConfigProcessor.process(any(InputStream.class))).thenReturn(processedApexConfig); final ApexApiResult apexApiResult = policyUploadHandler - .doUpload(mock(ApexModel.class), mock(InputStream.class), mock(InputStream.class)); + .doUpload(mock(ApexModel.class), mock(InputStream.class), mock(InputStream.class), USER_ID); assertThat("Response should not be ok", apexApiResult.isNok(), is(true)); assertThat("Response message should be as expected", @@ -134,7 +135,7 @@ public class PolicyUploadHandlerTest { processedToscaTemplate.addToErrors(Collections.singleton(errorMsg)); when(toscaTemplateProcessor.process(any(InputStream.class))).thenReturn(processedToscaTemplate); final ApexApiResult apexApiResult = policyUploadHandler - .doUpload(mock(ApexModel.class), mock(InputStream.class), mock(InputStream.class)); + .doUpload(mock(ApexModel.class), mock(InputStream.class), mock(InputStream.class), USER_ID); assertThat("Response should not be ok", apexApiResult.isNok(), is(true)); assertThat("Response message should be as expected", @@ -151,7 +152,7 @@ public class PolicyUploadHandlerTest { processedApexConfig.addToErrors(Collections.singleton(errorMsg)); when(apexConfigProcessor.process(any(InputStream.class))).thenReturn(processedApexConfig); final ApexApiResult apexApiResult = policyUploadHandler - .doUpload(mock(ApexModel.class), mock(InputStream.class), mock(InputStream.class)); + .doUpload(mock(ApexModel.class), mock(InputStream.class), mock(InputStream.class), USER_ID); assertThat("Response should not be ok", apexApiResult.isNok(), is(true)); assertThat("Response message should be as expected", @@ -173,7 +174,7 @@ public class PolicyUploadHandlerTest { .thenReturn(Response.ok().status(201).build()); final ApexApiResult apexApiResult = policyUploadHandler - .doUpload(apexModel, mock(InputStream.class), mock(InputStream.class)); + .doUpload(apexModel, mock(InputStream.class), mock(InputStream.class), USER_ID); assertThat("Response should not be ok", apexApiResult.isNok(), is(true)); final String expectedErrorMsg = String @@ -197,4 +198,4 @@ public class PolicyUploadHandlerTest { when(apexModel.getPolicyModel()).thenReturn(axPolicyModel); return apexModel; } -}
\ No newline at end of file +} |