diff --git a/authentication/esignet-integration-impl/src/test/java/io/mosip/authentication/esignet/integration/service/IdaAuditPluginImplTest.java b/authentication/esignet-integration-impl/src/test/java/io/mosip/authentication/esignet/integration/service/IdaAuditPluginImplTest.java index 9dc267df614..ceda8fd7c41 100644 --- a/authentication/esignet-integration-impl/src/test/java/io/mosip/authentication/esignet/integration/service/IdaAuditPluginImplTest.java +++ b/authentication/esignet-integration-impl/src/test/java/io/mosip/authentication/esignet/integration/service/IdaAuditPluginImplTest.java @@ -95,6 +95,11 @@ public void logAudit_WithValidStatus_ThenPass() throws Exception { new ParameterizedTypeReference() { }; Mockito.when(authTransactionHelper.getAuthToken()).thenReturn("authToken"); + Mockito.when(objectMapper.writeValueAsString(any())).thenReturn("requestBody"); + Mockito.when(restTemplate.exchange( + Mockito.any(RequestEntity.class), + Mockito.eq(responseType) + )).thenReturn(responseEntity); try { idaAuditPlugin.logAudit(username,action, status, auditDTO, null); Assert.assertTrue(true); @@ -115,6 +120,11 @@ public void logAudit_WithUnauthorizedStatus_ThenPass() throws Exception { new ParameterizedTypeReference() { }; Mockito.when(authTransactionHelper.getAuthToken()).thenReturn("authToken"); + Mockito.when(objectMapper.writeValueAsString(any())).thenReturn("requestBody"); + Mockito.when(restTemplate.exchange( + Mockito.any(RequestEntity.class), + Mockito.eq(responseType) + )).thenReturn(responseEntity); try { idaAuditPlugin.logAudit(username,action, status, auditDTO, null); Assert.assertTrue(true); @@ -135,6 +145,11 @@ public void logAudit_WithForbiddenStatus_ThenPass() throws Exception { new ParameterizedTypeReference() { }; Mockito.when(authTransactionHelper.getAuthToken()).thenReturn("authToken"); + Mockito.when(objectMapper.writeValueAsString(any())).thenReturn("requestBody"); + Mockito.when(restTemplate.exchange( + Mockito.any(RequestEntity.class), + Mockito.eq(responseType) + )).thenReturn(responseEntity); try { idaAuditPlugin.logAudit(username,action, status, auditDTO, null); Assert.assertTrue(true); diff --git a/db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B5_to_1.2.0.1_rollback.sql b/db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B5_to_1.2.0.1-B6_rollback.sql similarity index 72% rename from db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B5_to_1.2.0.1_rollback.sql rename to db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B5_to_1.2.0.1-B6_rollback.sql index 37b4fb58b16..15d4f96627b 100644 --- a/db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B5_to_1.2.0.1_rollback.sql +++ b/db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B5_to_1.2.0.1-B6_rollback.sql @@ -1,4 +1,3 @@ -\echo 'Upgrade Queries not required for the transition from 1.2.0.1-B5 to 1.2.0.1' ALTER TABLE ida.credential_event_store ALTER COLUMN credential_transaction_id type character varying(36); diff --git a/db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B5_to_1.2.0.1_upgrade.sql b/db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B5_to_1.2.0.1-B6_upgrade.sql similarity index 72% rename from db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B5_to_1.2.0.1_upgrade.sql rename to db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B5_to_1.2.0.1-B6_upgrade.sql index 39f231307f5..1400ca91bed 100644 --- a/db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B5_to_1.2.0.1_upgrade.sql +++ b/db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B5_to_1.2.0.1-B6_upgrade.sql @@ -1,8 +1,7 @@ -\echo 'Upgrade Queries not required for transition from 1.2.0.1-B5 to 1.2.0.1' +\c mosip_ida ALTER TABLE ida.credential_event_store ALTER COLUMN credential_transaction_id type character varying(64); DROP INDEX IF EXISTS ida.ind_otphsh; CREATE INDEX ind_refid ON ida.otp_transaction (ref_id,status_code); - diff --git a/db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B6_to_1.2.0.1_rollback.sql b/db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B6_to_1.2.0.1_rollback.sql new file mode 100644 index 00000000000..1a2e0a41c47 --- /dev/null +++ b/db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B6_to_1.2.0.1_rollback.sql @@ -0,0 +1 @@ +\echo 'Rollback Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION' \ No newline at end of file diff --git a/db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B6_to_1.2.0.1_upgrade.sql b/db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B6_to_1.2.0.1_upgrade.sql new file mode 100644 index 00000000000..381e2be11c1 --- /dev/null +++ b/db_upgrade_scripts/mosip_ida/sql/1.2.0.1-B6_to_1.2.0.1_upgrade.sql @@ -0,0 +1 @@ +\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION' \ No newline at end of file