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 { ...@@ -53,12 +53,12 @@ class KeycloakApiServiceTest {
class TestAddGroup { class TestAddGroup {
private final GroupRepresentation groupRepresentation = GroupRepresentationTestFactory.create(); private final GroupRepresentation groupRepresentation = GroupRepresentationTestFactory.create();
private final String RESOURCE_ID = GroupRepresentationTestFactory.create().getId(); private final String resourceId = GroupRepresentationTestFactory.create().getId();
@BeforeEach @BeforeEach
void init() { void init() {
when(groupsResource.add(groupRepresentation)).thenReturn(response); when(groupsResource.add(groupRepresentation)).thenReturn(response);
doReturn(RESOURCE_ID).when(service).getCreatedResourceIdFromResponse(response); doReturn(resourceId).when(service).getCreatedResourceIdFromResponse(response);
} }
@Test @Test
...@@ -79,7 +79,7 @@ class KeycloakApiServiceTest { ...@@ -79,7 +79,7 @@ class KeycloakApiServiceTest {
void shouldReturnAddedResourceId() { void shouldReturnAddedResourceId() {
var id = callService(); var id = callService();
assertThat(id).isEqualTo(RESOURCE_ID); assertThat(id).isEqualTo(resourceId);
} }
private String callService() { private String callService() {
...@@ -90,8 +90,8 @@ class KeycloakApiServiceTest { ...@@ -90,8 +90,8 @@ class KeycloakApiServiceTest {
@Nested @Nested
class TestGetCreatedResourceIdFromResponse { class TestGetCreatedResourceIdFromResponse {
private final String RESOURCE_ID = GroupRepresentationTestFactory.create().getId(); private final String resourceId = GroupRepresentationTestFactory.create().getId();
private final String LOCATION = LoremIpsum.getInstance().getUrl(); private final String location = LoremIpsum.getInstance().getUrl();
@Test @Test
void shouldExtractResourceIdFromLocationHeader() { void shouldExtractResourceIdFromLocationHeader() {
...@@ -99,7 +99,7 @@ class KeycloakApiServiceTest { ...@@ -99,7 +99,7 @@ class KeycloakApiServiceTest {
callService(); callService();
verify(service).extractResourceIdFromLocationHeader(LOCATION); verify(service).extractResourceIdFromLocationHeader(location);
} }
@Test @Test
...@@ -108,7 +108,7 @@ class KeycloakApiServiceTest { ...@@ -108,7 +108,7 @@ class KeycloakApiServiceTest {
var id = callService(); var id = callService();
assertThat(id).isEqualTo(RESOURCE_ID); assertThat(id).isEqualTo(resourceId);
} }
@Test @Test
...@@ -121,8 +121,8 @@ class KeycloakApiServiceTest { ...@@ -121,8 +121,8 @@ class KeycloakApiServiceTest {
private void givenResponseCreated() { private void givenResponseCreated() {
when(response.getStatus()).thenReturn(201); when(response.getStatus()).thenReturn(201);
when(response.getHeaderString("Location")).thenReturn(LOCATION); when(response.getHeaderString("Location")).thenReturn(location);
doReturn(RESOURCE_ID).when(service).extractResourceIdFromLocationHeader(LOCATION); doReturn(resourceId).when(service).extractResourceIdFromLocationHeader(location);
} }
private void givenResponseUnauthorized() { private void givenResponseUnauthorized() {
...@@ -138,14 +138,14 @@ class KeycloakApiServiceTest { ...@@ -138,14 +138,14 @@ class KeycloakApiServiceTest {
@Nested @Nested
class TestExtractResourceIdFromLocationHeader { class TestExtractResourceIdFromLocationHeader {
private final String RESOURCE_ID = GroupRepresentationTestFactory.create().getId(); private final String resourceId = GroupRepresentationTestFactory.create().getId();
private final String LOCATION = "https://keycloak-url.test/admin/realms/test/groups/" + RESOURCE_ID; private final String location = "https://keycloak-url.test/admin/realms/test/groups/" + resourceId;
@Test @Test
void shouldReturnId() { 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