Skip to content

Commit

Permalink
P4ADEV-1101 fixed naming
Browse files Browse the repository at this point in the history
  • Loading branch information
macacia committed Oct 7, 2024
1 parent c36667e commit 09b90ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void whenGetUserInfoFromMappedExternalUserIdThenUserNotFound() {
}

@Test
void whenGetClientIdThenGetClientSecret() {
void givenClientIdWhenGetClientSecretThenInvokeClientService() {
//Given
String organizationIpaCode = "organizationIpaCode";
String clientId = "clientId";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package it.gov.pagopa.payhub.auth.service.a2a;

import it.gov.pagopa.payhub.auth.mapper.ClientMapper;
import it.gov.pagopa.payhub.auth.model.Client;
import it.gov.pagopa.payhub.auth.service.DataCipherService;
import it.gov.pagopa.payhub.auth.service.a2a.registration.ClientRegistrationService;
import it.gov.pagopa.payhub.auth.mapper.ClientMapper;
import it.gov.pagopa.payhub.auth.service.a2a.retrieve.ClientRetrieverService;
import it.gov.pagopa.payhub.model.generated.ClientDTO;
import org.apache.commons.lang3.RandomUtils;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
Expand All @@ -16,6 +15,7 @@
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;

import java.util.Random;
import java.util.UUID;

@ExtendWith(MockitoExtension.class)
Expand Down Expand Up @@ -68,11 +68,12 @@ void whenRegisterClientThenIInvokeClientRegistrationService() {
}

@Test
void whenGetClientIdThenGetClientSecret() {
void givenClientIdWhenGetEncryptedClientSecretThenGetClientSecret() {
// Given
String organizationIpaCode = "organizationIpaCode";
String clientId = "clientId";
byte[] encryptedClientSecret = RandomUtils.nextBytes(16);
byte[] encryptedClientSecret = new byte[16];
new Random().nextBytes(encryptedClientSecret);
String clientSecretMock = UUID.randomUUID().toString();

Mockito.doReturn(encryptedClientSecret).when(clientRetrieverServiceMock).getClientSecret(organizationIpaCode, clientId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ClientRetrieverServiceTest {
private ClientRetrieverService service;

@Test
void whenGetClientIdThenReturnStoredClientSecret(){
void givenGetClientIdWhenReturnStoredClientSecretThenInvokeClientRetrieverService(){
// Given
String organizationIpaCode = "organizationIpaCode";
String clientName = "clientName";
Expand Down

0 comments on commit 09b90ad

Please sign in to comment.