Skip to content

Commit 6e18bf7

Browse files
author
Jakub Amanowicz
committed
handler tests fix
Signed-off-by: Jakub Amanowicz <jakub.amanowicz@here.com>
1 parent 2a5da09 commit 6e18bf7

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

here-naksha-lib-core/src/main/java/com/here/naksha/lib/core/models/naksha/EventTarget.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
package com.here.naksha.lib.core.models.naksha;
2020

2121
import java.util.List;
22-
import naksha.base.JvmBoxingUtil;
2322
import naksha.base.StringList;
2423
import naksha.model.objects.NakshaFeature;
2524
import org.jetbrains.annotations.NotNull;
@@ -33,7 +32,7 @@ public abstract class EventTarget<SELF extends EventTarget<SELF>> extends Naksha
3332
}
3433

3534
public @NotNull List<@NotNull String> getEventHandlerIds() {
36-
return JvmBoxingUtil.box(get(EVENT_HANDLER_IDS), StringList.class);
35+
return getOrSet(EVENT_HANDLER_IDS, new StringList());
3736
}
3837

3938
public @NotNull SELF addHandler(@NotNull String handlerId) {

here-naksha-lib-handlers/src/test/java/com/here/naksha/lib/handlers/SourceIdHandlerUnitTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ void testWriteRequestTagPopulation(final WriteRequest wf, final String expectedF
161161
when(event.sendUpstream(any())).thenReturn(new SuccessResponse());
162162

163163
// Given: Handler initialization
164-
final EventHandler e = new EventHandler(SourceIdHandler.class, "some_id");
164+
final EventHandler e = new EventHandler();
165+
e.setClassName(SourceIdHandler.class.getName());
166+
e.setId("some_id");
165167
final SourceIdHandler sourceIdHandler = new SourceIdHandler(naksha);
166168

167169
// When: handler processing logic is invoked

here-naksha-lib-handlers/src/test/java/com/here/naksha/lib/handlers/internal/IntHandlerForSpacesTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ private static Space space(String id, String title, String desc) {
147147
}
148148

149149
private static Space space(String id, String title, String desc, List<String> handlersIds) {
150-
Space space = new Space(id);
150+
Space space = new Space();
151+
space.setId(id);
151152
space.setTitle(title);
152153
space.setDescription(desc);
153154
for (String handlerId : handlersIds) {

here-naksha-lib-handlers/src/test/java/com/here/naksha/lib/handlers/internal/IntHandlerForStoragesTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ private static Stream<Arguments> invalidHttpProperties() {
113113
}
114114

115115
private Storage httpStorage(NakshaProperties xyzProperties) {
116-
Storage httpStorage = new Storage(HttpStorage.class, "test-http-storage");
116+
Storage httpStorage = new Storage();
117+
httpStorage.setClassName(HttpStorage.class.getName());
118+
httpStorage.setId("test-http-storage");
117119
httpStorage.setTitle("some title");
118120
httpStorage.setDescription("some desc");
119121
httpStorage.setProperties(xyzProperties);

0 commit comments

Comments
 (0)