Skip to content
Snippets Groups Projects
Commit 3b7ccd66 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6867 Change names of variables to camel case

parent 03b98781
No related branches found
No related tags found
No related merge requests found
......@@ -53,12 +53,12 @@ class KeycloakApiServiceTest {
class TestAddGroup {
private final GroupRepresentation groupRepresentation = GroupRepresentationTestFactory.create();
private final String RESOURCE_ID = GroupRepresentationTestFactory.create().getId();
private final String resourceId = GroupRepresentationTestFactory.create().getId();
@BeforeEach
void init() {
when(groupsResource.add(groupRepresentation)).thenReturn(response);
doReturn(RESOURCE_ID).when(service).getCreatedResourceIdFromResponse(response);
doReturn(resourceId).when(service).getCreatedResourceIdFromResponse(response);
}
@Test
......@@ -79,7 +79,7 @@ class KeycloakApiServiceTest {
void shouldReturnAddedResourceId() {
var id = callService();
assertThat(id).isEqualTo(RESOURCE_ID);
assertThat(id).isEqualTo(resourceId);
}
private String callService() {
......@@ -90,8 +90,8 @@ class KeycloakApiServiceTest {
@Nested
class TestGetCreatedResourceIdFromResponse {
private final String RESOURCE_ID = GroupRepresentationTestFactory.create().getId();
private final String LOCATION = LoremIpsum.getInstance().getUrl();
private final String resourceId = GroupRepresentationTestFactory.create().getId();
private final String location = LoremIpsum.getInstance().getUrl();
@Test
void shouldExtractResourceIdFromLocationHeader() {
......@@ -99,7 +99,7 @@ class KeycloakApiServiceTest {
callService();
verify(service).extractResourceIdFromLocationHeader(LOCATION);
verify(service).extractResourceIdFromLocationHeader(location);
}
@Test
......@@ -108,7 +108,7 @@ class KeycloakApiServiceTest {
var id = callService();
assertThat(id).isEqualTo(RESOURCE_ID);
assertThat(id).isEqualTo(resourceId);
}
@Test
......@@ -121,8 +121,8 @@ class KeycloakApiServiceTest {
private void givenResponseCreated() {
when(response.getStatus()).thenReturn(201);
when(response.getHeaderString("Location")).thenReturn(LOCATION);
doReturn(RESOURCE_ID).when(service).extractResourceIdFromLocationHeader(LOCATION);
when(response.getHeaderString("Location")).thenReturn(location);
doReturn(resourceId).when(service).extractResourceIdFromLocationHeader(location);
}
private void givenResponseUnauthorized() {
......@@ -138,14 +138,14 @@ class KeycloakApiServiceTest {
@Nested
class TestExtractResourceIdFromLocationHeader {
private final String RESOURCE_ID = GroupRepresentationTestFactory.create().getId();
private final String LOCATION = "https://keycloak-url.test/admin/realms/test/groups/" + RESOURCE_ID;
private final String resourceId = GroupRepresentationTestFactory.create().getId();
private final String location = "https://keycloak-url.test/admin/realms/test/groups/" + resourceId;
@Test
void shouldReturnId() {
var id = service.extractResourceIdFromLocationHeader(LOCATION);
var id = service.extractResourceIdFromLocationHeader(location);
assertThat(id).isEqualTo(RESOURCE_ID);
assertThat(id).isEqualTo(resourceId);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment