Skip to content

Commit 5a9a97a

Browse files
committed
feat: resolve conflicts after rebase.
https://gravitee.atlassian.net/browse/APIM-11696
1 parent 9ca7f62 commit 5a9a97a

File tree

9 files changed

+28
-26
lines changed

9 files changed

+28
-26
lines changed

gravitee-apim-rest-api/gravitee-apim-rest-api-management-v2/gravitee-apim-rest-api-management-v2-rest/src/main/java/io/gravitee/rest/api/management/v2/rest/mapper/PortalNavigationItemsMapper.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818
import io.gravitee.apim.core.portal_page.model.PortalArea;
1919
import io.gravitee.apim.core.portal_page.model.PortalNavigationFolder;
20+
import io.gravitee.apim.core.portal_page.model.PortalNavigationItemId;
2021
import io.gravitee.apim.core.portal_page.model.PortalNavigationLink;
2122
import io.gravitee.apim.core.portal_page.model.PortalNavigationPage;
2223
import io.gravitee.apim.core.portal_page.model.PortalPageContentId;
23-
import io.gravitee.apim.core.portal_page.model.PortalPageNavigationId;
2424
import io.gravitee.rest.api.management.v2.rest.model.CreatePortalNavigationItem;
2525
import io.gravitee.rest.api.management.v2.rest.model.PortalNavigationItem;
2626
import org.mapstruct.Mapper;
@@ -40,12 +40,12 @@ public interface PortalNavigationItemsMapper {
4040
PortalNavigationItem map(io.gravitee.apim.core.portal_page.model.PortalNavigationItem portalNavigationItem);
4141

4242
@Named("mapId")
43-
default String mapId(PortalPageNavigationId id) {
43+
default String mapId(PortalNavigationItemId id) {
4444
return id == null ? null : id.toString();
4545
}
4646

4747
@Named("mapParentId")
48-
default String mapParentId(PortalPageNavigationId id) {
48+
default String mapParentId(PortalNavigationItemId id) {
4949
return id == null ? null : id.toString();
5050
}
5151

@@ -76,11 +76,11 @@ default io.gravitee.apim.core.portal_page.model.PortalNavigationItem map(
7676
String environmentId,
7777
CreatePortalNavigationItem createPortalNavigationItem
7878
) {
79-
final var id = PortalPageNavigationId.random();
79+
final var id = PortalNavigationItemId.random();
8080
final var title = createPortalNavigationItem.getTitle();
8181
final var area = createPortalNavigationItem.getArea();
8282
final var parentIdStr = createPortalNavigationItem.getParentId();
83-
final var parentId = parentIdStr == null ? null : PortalPageNavigationId.of(parentIdStr);
83+
final var parentId = parentIdStr == null ? null : PortalNavigationItemId.of(parentIdStr);
8484
final var contentIdStr = createPortalNavigationItem.getContentId();
8585
final var contentId = contentIdStr == null ? null : PortalPageContentId.of(contentIdStr);
8686
final var uri = createPortalNavigationItem.getUri();

gravitee-apim-rest-api/gravitee-apim-rest-api-service/src/main/java/io/gravitee/apim/core/portal_page/crud_service/PortalNavigationItemCrudService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
package io.gravitee.apim.core.portal_page.crud_service;
1717

1818
import io.gravitee.apim.core.portal_page.model.PortalNavigationItem;
19-
import io.gravitee.apim.core.portal_page.model.PortalPageNavigationId;
19+
import io.gravitee.apim.core.portal_page.model.PortalNavigationItemId;
2020

2121
public interface PortalNavigationItemCrudService {
2222
PortalNavigationItem create(PortalNavigationItem portalNavigationItem);
2323

2424
PortalNavigationItem update(PortalNavigationItem portalNavigationItem);
2525

26-
void delete(PortalPageNavigationId portalNavigationItemId);
26+
void delete(PortalNavigationItemId portalNavigationItemId);
2727
}

gravitee-apim-rest-api/gravitee-apim-rest-api-service/src/main/java/io/gravitee/apim/core/portal_page/model/PortalNavigationLink.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public PortalNavigationLink(
3333
@Nonnull String environmentId,
3434
@Nonnull String title,
3535
@Nonnull PortalArea area,
36-
@Nullable PortalPageNavigationId parentId,
36+
@Nullable PortalNavigationItemId parentId,
3737
@Nonnull String href
3838
) {
3939
super(id, organizationId, environmentId, title, area, parentId);

gravitee-apim-rest-api/gravitee-apim-rest-api-service/src/main/java/io/gravitee/apim/core/portal_page/use_case/CreatePortalNavigationItemUseCase.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import io.gravitee.apim.core.portal_page.exception.PortalPageSpecificationException;
2121
import io.gravitee.apim.core.portal_page.model.PortalNavigationFolder;
2222
import io.gravitee.apim.core.portal_page.model.PortalNavigationItem;
23-
import io.gravitee.apim.core.portal_page.model.PortalPageNavigationId;
2423
import io.gravitee.apim.core.portal_page.query_service.PortalNavigationItemsQueryService;
2524
import lombok.Builder;
2625
import lombok.RequiredArgsConstructor;

gravitee-apim-rest-api/gravitee-apim-rest-api-service/src/main/java/io/gravitee/apim/infra/query_service/portal_page/PortalNavigationItemsCrudServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import io.gravitee.apim.core.exception.TechnicalDomainException;
1919
import io.gravitee.apim.core.portal_page.crud_service.PortalNavigationItemCrudService;
2020
import io.gravitee.apim.core.portal_page.model.PortalNavigationItem;
21-
import io.gravitee.apim.core.portal_page.model.PortalPageNavigationId;
21+
import io.gravitee.apim.core.portal_page.model.PortalNavigationItemId;
2222
import io.gravitee.apim.infra.adapter.PortalNavigationItemAdapter;
2323
import io.gravitee.repository.exceptions.TechnicalException;
2424
import io.gravitee.repository.management.api.PortalNavigationItemRepository;
@@ -73,7 +73,7 @@ public PortalNavigationItem update(PortalNavigationItem portalNavigationItem) {
7373
}
7474

7575
@Override
76-
public void delete(PortalPageNavigationId portalNavigationItemId) {
76+
public void delete(PortalNavigationItemId portalNavigationItemId) {
7777
try {
7878
portalNavigationItemRepository.delete(portalNavigationItemId.toString());
7979
} catch (TechnicalException e) {

gravitee-apim-rest-api/gravitee-apim-rest-api-service/src/test/java/inmemory/PortalNavigationItemsCrudServiceInMemory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import io.gravitee.apim.core.portal_page.crud_service.PortalNavigationItemCrudService;
1919
import io.gravitee.apim.core.portal_page.model.PortalNavigationItem;
20-
import io.gravitee.apim.core.portal_page.model.PortalPageNavigationId;
20+
import io.gravitee.apim.core.portal_page.model.PortalNavigationItemId;
2121
import java.util.ArrayList;
2222
import java.util.List;
2323
import java.util.OptionalInt;
@@ -52,7 +52,7 @@ public PortalNavigationItem update(PortalNavigationItem portalNavigationItem) {
5252
}
5353

5454
@Override
55-
public void delete(PortalPageNavigationId portalNavigationItemId) {
55+
public void delete(PortalNavigationItemId portalNavigationItemId) {
5656
storage.removeIf(page -> page.getId().equals(portalNavigationItemId));
5757
}
5858

gravitee-apim-rest-api/gravitee-apim-rest-api-service/src/test/java/io/gravitee/apim/core/portal_page/use_case/CreatePortalNavigationItemUseCaseTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
import io.gravitee.apim.core.portal_page.model.PortalArea;
2626
import io.gravitee.apim.core.portal_page.model.PortalNavigationFolder;
2727
import io.gravitee.apim.core.portal_page.model.PortalNavigationItem;
28-
import io.gravitee.apim.core.portal_page.model.PortalPageNavigationId;
2928
import java.util.ArrayList;
29+
import io.gravitee.apim.core.portal_page.model.PortalNavigationItemId;
3030
import org.junit.function.ThrowingRunnable;
3131
import org.junit.jupiter.api.BeforeEach;
3232
import org.junit.jupiter.api.DisplayNameGeneration;
@@ -58,7 +58,7 @@ void setUp() {
5858
void should_create_top_level_navigation_item_when_parent_id_is_null() {
5959
// Given
6060
final var portalNavigationItem = new PortalNavigationFolder(
61-
PortalPageNavigationId.random(),
61+
PortalNavigationItemId.random(),
6262
ORG_ID,
6363
ENV_ID,
6464
"title",
@@ -78,12 +78,12 @@ void should_create_top_level_navigation_item_when_parent_id_is_null() {
7878
void should_create_nested_navigation_item_when_parent_id_is_not_null() {
7979
// Given
8080
final var portalNavigationItem = new PortalNavigationFolder(
81-
PortalPageNavigationId.random(),
81+
PortalNavigationItemId.random(),
8282
ORG_ID,
8383
ENV_ID,
8484
"title",
8585
PortalArea.TOP_NAVBAR,
86-
PortalPageNavigationId.of(APIS_ID)
86+
PortalNavigationItemId.of(APIS_ID)
8787
);
8888

8989
// When
@@ -92,7 +92,7 @@ void should_create_nested_navigation_item_when_parent_id_is_not_null() {
9292
// Then
9393
final var result = queryService.findByParentIdAndEnvironmentId(
9494
portalNavigationItem.getEnvironmentId(),
95-
PortalPageNavigationId.of(APIS_ID)
95+
PortalNavigationItemId.of(APIS_ID)
9696
);
9797
assertThat(result).extracting(PortalNavigationItem::getId).contains(portalNavigationItem.getId());
9898
}
@@ -101,12 +101,12 @@ void should_create_nested_navigation_item_when_parent_id_is_not_null() {
101101
void should_fail_when_parent_is_not_folder() {
102102
// Given
103103
final var portalNavigationItem = new PortalNavigationFolder(
104-
PortalPageNavigationId.random(),
104+
PortalNavigationItemId.random(),
105105
ORG_ID,
106106
ENV_ID,
107107
"title",
108108
PortalArea.TOP_NAVBAR,
109-
PortalPageNavigationId.of(PAGE11_ID)
109+
PortalNavigationItemId.of(PAGE11_ID)
110110
);
111111

112112
// When

gravitee-apim-rest-api/gravitee-apim-rest-api-service/src/test/java/io/gravitee/apim/infra/adapter/PortalNavigationItemAdapterTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ void should_map_folder_to_repository() {
213213
"org-id",
214214
"env-id",
215215
"My Folder",
216-
PortalArea.TOP_NAVBAR
216+
PortalArea.TOP_NAVBAR,
217+
PortalNavigationItemId.of("550e8400-e29b-41d4-a716-446655440011")
217218
);
218-
entity.setParentId(PortalNavigationItemId.of("550e8400-e29b-41d4-a716-446655440011"));
219219
entity.setOrder(1);
220220

221221
// When
@@ -242,6 +242,7 @@ void should_map_page_to_repository() {
242242
"env-id",
243243
"My Page",
244244
PortalArea.HOMEPAGE,
245+
null,
245246
PortalPageContentId.of("550e8400-e29b-41d4-a716-446655440013")
246247
);
247248
entity.setOrder(2);
@@ -269,6 +270,7 @@ void should_map_link_to_repository() {
269270
"env-id",
270271
"My Link",
271272
PortalArea.TOP_NAVBAR,
273+
null,
272274
"https://example.com"
273275
);
274276
entity.setOrder(3);
@@ -296,6 +298,7 @@ void should_handle_null_parent_id() {
296298
"env-id",
297299
"My Folder",
298300
PortalArea.TOP_NAVBAR
301+
, null
299302
);
300303

301304
// When

gravitee-apim-rest-api/gravitee-apim-rest-api-service/src/test/java/io/gravitee/apim/infra/query_service/portal_page/PortalNavigationItemsCrudServiceImplTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020

2121
import io.gravitee.apim.core.portal_page.model.PortalArea;
2222
import io.gravitee.apim.core.portal_page.model.PortalNavigationFolder;
23+
import io.gravitee.apim.core.portal_page.model.PortalNavigationItemId;
2324
import io.gravitee.apim.core.portal_page.model.PortalNavigationLink;
2425
import io.gravitee.apim.core.portal_page.model.PortalNavigationPage;
2526
import io.gravitee.apim.core.portal_page.model.PortalPageContentId;
26-
import io.gravitee.apim.core.portal_page.model.PortalPageNavigationId;
2727
import io.gravitee.repository.exceptions.TechnicalException;
2828
import io.gravitee.repository.management.api.PortalNavigationItemRepository;
2929
import io.gravitee.repository.management.model.PortalNavigationItem;
@@ -60,7 +60,7 @@ class CreatePortalNavigationItem {
6060

6161
@Test
6262
void should_create_a_folder() throws TechnicalException {
63-
final var itemId = PortalPageNavigationId.random();
63+
final var itemId = PortalNavigationItemId.random();
6464
final var item = new PortalNavigationFolder(itemId, "organizationId", "environmentId", "title", PortalArea.TOP_NAVBAR, null);
6565

6666
service.create(item);
@@ -82,7 +82,7 @@ void should_create_a_folder() throws TechnicalException {
8282

8383
@Test
8484
void should_create_a_page() throws TechnicalException {
85-
final var itemId = PortalPageNavigationId.random();
85+
final var itemId = PortalNavigationItemId.random();
8686
final var contentId = PortalPageContentId.random();
8787
final var item = new PortalNavigationPage(
8888
itemId,
@@ -113,7 +113,7 @@ void should_create_a_page() throws TechnicalException {
113113

114114
@Test
115115
void should_create_a_link() throws TechnicalException {
116-
final var itemId = PortalPageNavigationId.random();
116+
final var itemId = PortalNavigationItemId.random();
117117
final var contentId = PortalPageContentId.random();
118118
final var href = "http://example.com";
119119
final var item = new PortalNavigationLink(

0 commit comments

Comments
 (0)