Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Naksha_2.2.19
- Changed from Java 17 to Java 11 for naksha-lib-mm-util project.

## Naksha_2.2.18
- Fix snakeyaml conflicting versions.

Expand Down
6 changes: 6 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,12 @@ project(":here-naksha-app-service") {

project(":here-naksha-lib-mm-util"){
description = "Naksha Namespace Util library"
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withJavadocJar()
withSourcesJar()
}
dependencies {
implementation(project(":here-naksha-lib-core"))

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ mavenPassword=YourPassword
# - here-naksha-lib-core/src/main/com/here/naksha/lib/core/NakshaVersion (static property: latest)
# - here-naksha-app-service/src/main/resources/swagger/openapi.yaml (info.version property)
# - CHANGELOG.md
version=2.2.18
version=2.2.19

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ servers:
info:
title: "Naksha Hub-API"
description: "Naksha Hub-API is a REST API to provide simple access to geo data."
version: "2.2.18"
version: "2.2.19"

security:
- AccessToken: [ ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@ public class NakshaVersion implements Comparable<NakshaVersion> {
public static final String v2_2_16 = "2.2.16";
public static final String v2_2_17 = "2.2.17";
public static final String v2_2_18 = "2.2.18";
public static final String v2_2_19 = "2.2.19";

/**
* The latest version of the naksha-extension stored in the resources.
*/
@AvailableSince(v2_0_5)
public static final NakshaVersion latest = of(v2_2_17);
public static final NakshaVersion latest = of(v2_2_19);

private final int major;
private final int minor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package com.here.naksha.mom10;

class DeltaProperties {

private DeltaProperties() {}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public static boolean isMom10OrGreater(JsonObject rawFeature) {
Map properties = nestedMapOrNull(rawFeature, XyzFeature.PROPERTIES);
if (properties != null) {
Map meta = nestedMapOrNull(properties, MetaProperties.META);
if (meta != null && meta.get(MetaProperties.MODEL_VERSION) instanceof String modelVersion) {
if (meta != null && meta.get(MetaProperties.MODEL_VERSION) instanceof String) {
String modelVersion = (String) meta.get(MetaProperties.MODEL_VERSION);
return specifiesAtLeastMom10(modelVersion);
}
}
Expand All @@ -62,8 +63,8 @@ private static boolean specifiesAtLeastMom10(@NotNull String modelVersion) {

private static @Nullable Map<String, Object> nestedMapOrNull(Map rawFeature, String propertyName) {
Object property = rawFeature.get(propertyName);
if (property instanceof Map nested) {
return nested;
if (property instanceof Map) {
return (Map) property;
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@

class Mom10VerificationTest {

record VerificationCase(JsonObject rawFeature, boolean isAtLeastMom10) {}
private static class VerificationCase {

private final JsonObject rawFeature;
private final boolean isAtLeastMom10;

public VerificationCase(JsonObject rawFeature, boolean isAtLeastMom10) {
this.rawFeature = rawFeature;
this.isAtLeastMom10 = isAtLeastMom10;
}
}

@ParameterizedTest
@MethodSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,25 @@ public class TransformationSamples {
private TransformationSamples() {
}

public record TransformationSample(
String sourceDir,
XyzFeature mom10,
XyzFeature nakshaInternal
) {
public static final class TransformationSample {

private final String sourceDir;
private final XyzFeature mom10;
private final XyzFeature nakshaInternal;

public TransformationSample(String sourceDir, XyzFeature mom10, XyzFeature nakshaInternal) {
this.sourceDir = sourceDir;
this.mom10 = mom10;
this.nakshaInternal = nakshaInternal;
}

public XyzFeature getMom10() {
return mom10;
}

public XyzFeature getNakshaInternal() {
return nakshaInternal;
}

@Override
public String toString() {
Expand Down Expand Up @@ -59,6 +73,7 @@ private static class SamplesLoader {

// initialization on demand
private static final List<TransformationSample> LOADED_SAMPLES;

static {
List<Path> dirs = samplesDirs();
LOADED_SAMPLES = new ArrayList<>(dirs.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ class Mom10TransformationTest {
@MethodSource("com.here.naksha.mom10.TransformationSamples#streamSamples")
void shouldPopulatePreMom10Namespaces(TransformationSample versionedFeatures) {
// When
Mom10Transformation.populatePreMom10Namespaces(versionedFeatures.mom10());
Mom10Transformation.populatePreMom10Namespaces(versionedFeatures.getMom10());

// Then:
assertFeaturesEqual(
versionedFeatures.nakshaInternal(), // expected - untouched
versionedFeatures.mom10() // actual - transformed
versionedFeatures.getNakshaInternal(), // expected - untouched
versionedFeatures.getMom10() // actual - transformed
);
}

@ParameterizedTest
@MethodSource("com.here.naksha.mom10.TransformationSamples#streamSamples")
void shouldDropPreMom10Namespaces(TransformationSample versionedFeatures) {
// When
Mom10Transformation.dropPreMom10Namespaces(versionedFeatures.nakshaInternal());
Mom10Transformation.dropPreMom10Namespaces(versionedFeatures.getNakshaInternal());

// Then:
assertFeaturesEqual(versionedFeatures.mom10(), versionedFeatures.nakshaInternal());
assertFeaturesEqual(versionedFeatures.getMom10(), versionedFeatures.getNakshaInternal());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

Expand Down Expand Up @@ -75,16 +74,22 @@ private static void verifyAndDropNullsSetByNaksha(Map expectedModerationInfo, Ma
private static void assertObjectEqual(Object expectedValue, Object actualValue, String path) {
if (expectedValue == null) {
assertNull(actualValue, "Expected null value under path: " + path);
} else if (expectedValue instanceof Map expectedMapValue) {
} else if (expectedValue instanceof Map) {
Map expectedMapValue = (Map) expectedValue;
assertInstanceOf(Map.class, actualValue);
assertMapsEqual(expectedMapValue, (Map) actualValue, path);
} else if (expectedValue instanceof List expectedListValue) {
} else if (expectedValue instanceof List) {
List expectedListValue = (List) expectedValue;
assertInstanceOf(List.class, actualValue);
assertListsEqual(expectedListValue, (List) actualValue, path);
} else if (expectedValue instanceof JsonEnum expectedJsonEnum && actualValue instanceof String actualString) {
} else if (expectedValue instanceof JsonEnum && actualValue instanceof String) {
JsonEnum expectedJsonEnum = (JsonEnum) expectedValue;
String actualString = (String) actualValue;
assertEquals(expectedJsonEnum.value(), actualString,
"Expected " + expectedValue + " but got " + actualValue + " under path: " + path);
} else if (actualValue instanceof JsonEnum actualJsonEnum && expectedValue instanceof String expectedString) {
} else if (actualValue instanceof JsonEnum && expectedValue instanceof String) {
JsonEnum actualJsonEnum = (JsonEnum) actualValue;
String expectedString = (String) expectedValue;
assertEquals(expectedString, actualJsonEnum.value(),
"Expected " + expectedValue + " but got " + actualValue + " under path: " + path);
} else {
Expand Down
Loading