From 180b67b2a7e958c0be12b5858429c92703ec4b16 Mon Sep 17 00:00:00 2001 From: ChrisS1512 <87066931+ChrisS1512@users.noreply.github.com> Date: Thu, 5 Dec 2024 13:40:27 +0000 Subject: [PATCH] PUB-2681 - Updated integration tests --- .../reform/pip/account/management/controllers/AccountTest.java | 2 ++ .../management/controllers/SystemAdminB2CAccountTest.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/integrationTest/java/uk/gov/hmcts/reform/pip/account/management/controllers/AccountTest.java b/src/integrationTest/java/uk/gov/hmcts/reform/pip/account/management/controllers/AccountTest.java index f6913d0e..701ab8ea 100644 --- a/src/integrationTest/java/uk/gov/hmcts/reform/pip/account/management/controllers/AccountTest.java +++ b/src/integrationTest/java/uk/gov/hmcts/reform/pip/account/management/controllers/AccountTest.java @@ -610,6 +610,7 @@ void testDeleteAccountNotFound() throws Exception { } @Test + @Sql(executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD, scripts = "classpath:add-admin-users.sql") void testV2SystemAdminDeletesVerifiedUser() throws Exception { validUser.setUserProvenance(UserProvenances.CFT_IDAM); validUser.setRoles(Roles.VERIFIED); @@ -675,6 +676,7 @@ void testV2SystemAdminDeletesThirdPartyUser() throws Exception { } @Test + @Sql(executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD, scripts = "classpath:add-admin-users.sql") void testV2SystemAdminDeletesSuperAdminUser() throws Exception { superAdminUser.setUserProvenance(UserProvenances.CFT_IDAM); String superAdminUserId = getSuperAdminUserId(superAdminUser); diff --git a/src/integrationTest/java/uk/gov/hmcts/reform/pip/account/management/controllers/SystemAdminB2CAccountTest.java b/src/integrationTest/java/uk/gov/hmcts/reform/pip/account/management/controllers/SystemAdminB2CAccountTest.java index 30f83303..f347f36f 100644 --- a/src/integrationTest/java/uk/gov/hmcts/reform/pip/account/management/controllers/SystemAdminB2CAccountTest.java +++ b/src/integrationTest/java/uk/gov/hmcts/reform/pip/account/management/controllers/SystemAdminB2CAccountTest.java @@ -32,6 +32,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.UUID; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; @@ -223,7 +224,7 @@ void testUnauthorizedCreateSystemAdminAccount() throws Exception { MockMvcRequestBuilders .post(CREATE_SYSTEM_ADMIN_URL) .content(OBJECT_MAPPER.writeValueAsString(systemAdmin)) - .header(ISSUER_HEADER, ISSUER_ID) + .header(ISSUER_HEADER, UUID.randomUUID().toString()) .contentType(MediaType.APPLICATION_JSON); MvcResult responseCreateSystemAdminUser = mockMvc.perform(createRequest)