@@ -13,92 +13,81 @@ class PalantirDeeplyNestedCalls {
1313 .build()))
1414 .build();
1515
16+ void testMethod() {
17+ assertThat(ConfigServiceV1.getAllItems(item1, item2, item3, item4))
18+ .containsExactlyInAnyOrderElementsOf(Set.of(
19+ new ItemWithCustomLocator(
20+ ItemConfigV1.DEFAULT_CONFIG.toCustomString(),
21+ ItemConfigV1.createCustomConfig(ItemConfigV1Locator.of(TEST_ITEM_A))),
22+ new ItemWithCustomLocator(
23+ ItemConfigV1.builder()
24+ .id(getId(TEST_ITEM_A))
25+ .name(ItemName.of(TEST_API_NAME.get()))
26+ .apiName(TEST_API_NAME)
27+ .spec(ItemConfigV1Spec.native_(NativeItemConfigV1Spec.model(TestModel.of())))
28+ .category(TestCatalog.TEST_CATEGORY_ALPHA)
29+ .creator(TestCatalog.TEST_CREATOR_BETA)
30+ .status(ItemLifecycleStatus.EXPERIMENTAL)
31+ .statusV2(ItemLifecycleStatusV2.experimental(LifecycleStatusExperimental.of()))
32+ .inputSpec(ItemInputSpec.unknownInputType(UnknownInputSpec.of()))
33+ .creationDate(ItemMetadataInfo.builder().build())
34+ .performanceAttributes(
35+ ItemAttributes.builder().build())
36+ .categories(TestCatalog.TEST_CATEGORY_ALPHA)
37+ .build(),
38+ CustomItemLocator.hosted(HostedItemLocator.of(TEST_ITEM_B))),
39+ new ItemWithCustomLocator(
40+ ItemConfigV1.builder()
41+ .id(getId(TestModelCatalog.MODEL_XYZ_123.apiName()))
42+ .name(ItemName.of(TestModelCatalog.MODEL_XYZ_123
43+ .apiName()
44+ .get()))
45+ .apiName(TestModelCatalog.MODEL_XYZ_123.apiName())
46+ .spec(ItemConfigV1Spec.native_(
47+ NativeItemConfigV1Spec.hubModel(HubModelSpec.of())))
48+ .category(TestCatalog.TEST_CATEGORY_ALPHA)
49+ .creator(TestCatalog.TEST_CREATOR_BETA)
50+ .status(ItemLifecycleStatus.EXPERIMENTAL)
51+ .statusV2(ItemLifecycleStatusV2.experimental(LifecycleStatusExperimental.of()))
52+ .inputSpec(ItemInputSpec.unknownInputType(UnknownInputSpec.of()))
53+ .creationDate(ItemMetadataInfo.builder().build())
54+ .performanceAttributes(
55+ ItemAttributes.builder().build())
56+ .categories(TestCatalog.TEST_CATEGORY_ALPHA)
57+ .build(),
58+ CustomItemLocator.hosted(HostedItemLocator.of(TEST_ITEM_C))),
59+ // Discovered items
60+ new ItemWithCustomLocator(
61+ TestModelCatalog.MODEL_ABC_456.toItemApi(),
62+ CustomItemLocator.discovered(DiscoveredItemLocator.of())),
63+ new ItemWithCustomLocator(
64+ ItemConfigV1.builder()
65+ .id(getId(TEST_API_NAME))
66+ .name(ItemName.of(TEST_API_NAME.get()))
67+ .apiName(TEST_API_NAME)
68+ .spec(ItemConfigV1Spec.native_(
69+ NativeItemConfigV1Spec.hubModel(HubModelSpec.of())))
70+ .category(TestCatalog.TEST_CATEGORY_ALPHA)
71+ .creator(TestCatalog.TEST_CREATOR_BETA)
72+ .status(ItemLifecycleStatus.EXPERIMENTAL)
73+ .statusV2(ItemLifecycleStatusV2.experimental(LifecycleStatusExperimental.of()))
74+ .inputSpec(ItemInputSpec.unknownInputType(UnknownInputSpec.of()))
75+ .creationDate(ItemMetadataInfo.builder().build())
76+ .performanceAttributes(
77+ ItemAttributes.builder().build())
78+ .categories(TestCatalog.TEST_CATEGORY_ALPHA)
79+ .build(),
80+ CustomItemLocator.discovered(DiscoveredItemLocator.of()))));
81+ }
1682
17- void testMethod() {
18- assertThat(ConfigServiceV1.getAllItems(item1, item2, item3, item4))
19- .containsExactlyInAnyOrderElementsOf(Set.of(
20- new ItemWithCustomLocator(
21- ItemConfigV1.DEFAULT_CONFIG.toCustomString(),
22- ItemConfigV1.createCustomConfig(
23- ItemConfigV1Locator.of(TEST_ITEM_A))),
24- new ItemWithCustomLocator(
25- ItemConfigV1.builder()
26- .id(getId(TEST_ITEM_A))
27- .name(ItemName.of(TEST_API_NAME.get()))
28- .apiName(TEST_API_NAME)
29- .spec(ItemConfigV1Spec.native_(
30- NativeItemConfigV1Spec.model(TestModel.of())))
31- .category(TestCatalog.TEST_CATEGORY_ALPHA)
32- .creator(TestCatalog.TEST_CREATOR_BETA)
33- .status(ItemLifecycleStatus.EXPERIMENTAL)
34- .statusV2(ItemLifecycleStatusV2.experimental(
35- LifecycleStatusExperimental.of()))
36- .inputSpec(ItemInputSpec.unknownInputType(UnknownInputSpec.of()))
37- .creationDate(
38- ItemMetadataInfo.builder().build())
39- .performanceAttributes(
40- ItemAttributes.builder().build())
41- .categories(TestCatalog.TEST_CATEGORY_ALPHA)
42- .build(),
43- CustomItemLocator.hosted(
44- HostedItemLocator.of(TEST_ITEM_B))),
45- new ItemWithCustomLocator(
46- ItemConfigV1.builder()
47- .id(getId(TestModelCatalog.MODEL_XYZ_123.apiName()))
48- .name(ItemName.of(TestModelCatalog.MODEL_XYZ_123
49- .apiName()
50- .get()))
51- .apiName(TestModelCatalog.MODEL_XYZ_123.apiName())
52- .spec(ItemConfigV1Spec.native_(NativeItemConfigV1Spec.hubModel(
53- HubModelSpec.of())))
54- .category(TestCatalog.TEST_CATEGORY_ALPHA)
55- .creator(TestCatalog.TEST_CREATOR_BETA)
56- .status(ItemLifecycleStatus.EXPERIMENTAL)
57- .statusV2(ItemLifecycleStatusV2.experimental(
58- LifecycleStatusExperimental.of()))
59- .inputSpec(ItemInputSpec.unknownInputType(UnknownInputSpec.of()))
60- .creationDate(
61- ItemMetadataInfo.builder().build())
62- .performanceAttributes(
63- ItemAttributes.builder().build())
64- .categories(TestCatalog.TEST_CATEGORY_ALPHA)
65- .build(),
66- CustomItemLocator.hosted(
67- HostedItemLocator.of(TEST_ITEM_C))),
68- // Discovered items
69- new ItemWithCustomLocator(
70- TestModelCatalog.MODEL_ABC_456.toItemApi(),
71- CustomItemLocator.discovered(DiscoveredItemLocator.of())),
72- new ItemWithCustomLocator(
73- ItemConfigV1.builder()
74- .id(getId(TEST_API_NAME))
75- .name(ItemName.of(TEST_API_NAME.get()))
76- .apiName(TEST_API_NAME)
77- .spec(ItemConfigV1Spec.native_(NativeItemConfigV1Spec.hubModel(
78- HubModelSpec.of())))
79- .category(TestCatalog.TEST_CATEGORY_ALPHA)
80- .creator(TestCatalog.TEST_CREATOR_BETA)
81- .status(ItemLifecycleStatus.EXPERIMENTAL)
82- .statusV2(ItemLifecycleStatusV2.experimental(
83- LifecycleStatusExperimental.of()))
84- .inputSpec(ItemInputSpec.unknownInputType(UnknownInputSpec.of()))
85- .creationDate(
86- ItemMetadataInfo.builder().build())
87- .performanceAttributes(
88- ItemAttributes.builder().build())
89- .categories(TestCatalog.TEST_CATEGORY_ALPHA)
90- .build(),
91- CustomItemLocator.discovered(DiscoveredItemLocator.of()))));
92- }
93-
94- public Map<FooBarRid, BazQuxMetrics> otherMethod(
95- FooAuthHeader authHeader, Set<FooBarRid> thingRids, WidgetTimeRange timeRange) {
96- return myCustomService
97- .get()
98- .fetchData(authHeader, FooMyCustomClass.of(thingRids, timeRange))
99- .entrySet()
100- .stream()
101- .collect(Collectors.toMap(
102- Map.Entry::getKey, entry -> entry.getValue().getMetrics()));
103- }
104- }
83+ public Map<FooBarRid, BazQuxMetrics> otherMethod(
84+ FooAuthHeader authHeader, Set<FooBarRid> thingRids, WidgetTimeRange timeRange) {
85+ return myCustomService
86+ .get()
87+ .fetchData(authHeader, FooMyCustomClass.of(thingRids, timeRange))
88+ .entrySet()
89+ .stream()
90+ .collect(Collectors.toMap(
91+ Map.Entry::getKey, entry -> entry.getValue().getMetrics()));
92+ }
93+ }
0 commit comments