Skip to content

Commit c130091

Browse files
committed
CASL-1466 review fixes
Signed-off-by: Jakub Amanowicz <[email protected]>
1 parent 954f180 commit c130091

File tree

3 files changed

+28
-23
lines changed

3 files changed

+28
-23
lines changed

here-naksha-lib-mom10/README.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Because of the above, Naksha has to:
1818

1919
### Checking `modelVersion`
2020

21-
[Mom10Verification](src/jvmMain/java/com/here/naksha/mom10/Mom10Verification.java) is responsible for
21+
[Mom10Verification](src/jvmMain/java/com/here/naksha/mom10/Mom10Verification.java) is responsible
22+
for
2223
checking whether given feature **has MOM version equal or greater to `10.0.0`**.
2324
This information can be used to determine whether a further processing is required.
2425

@@ -41,23 +42,24 @@ previously stored MOM 10 feature (described above):
4142
- we return feature in the same shape as it was given to Naksha in the writing phase
4243

4344
The class responsible for these operations
44-
is [Mom10Transformation](../java/com/here/naksha/mom10/transform/Mom10Transformation.java).
45+
is [Mom10Transformation](src/jvmMain/java/com/here/naksha/mom10/Mom10Transformation.java).
4546

4647
#### Populating old delta
4748

48-
| `@ns:com:here:mom:delta` properties supported in Naksha V2 (pre MOM 10) | equivalents in `meta.moderationInfo` (MOM 10+) |
49-
|-------------------------------------------------------------------------|------------------------------------------------|
50-
| `originId` | `originId` |
51-
| `parentLink` | `parentLink` |
52-
| `changeState` | `changeState` |
53-
| `reviewState` | `reviewState` |
54-
| `streamId` | not applicable |
55-
| `potentialValue` | not applicable |
56-
| `priorityCategory` | not applicable |
57-
| `dueTS` | not applicable |
58-
| `changeCounter` | not applicable |
59-
60-
Only the properties supported in both old delta NS and new `moderationInfo` will be used for population of `@ns:com:here:mom:delta` namespace.
49+
| `@ns:com:here:mom:delta` properties supported in Naksha (pre MOM 10) | equivalents in `meta.moderationInfo` (MOM 10+) |
50+
|----------------------------------------------------------------------|------------------------------------------------|
51+
| `originId` | `originId` |
52+
| `parentLink` | `parentLink` |
53+
| `changeState` | `changeState` |
54+
| `reviewState` | `reviewState` |
55+
| `streamId` | not applicable |
56+
| `potentialValue` | not applicable |
57+
| `priorityCategory` | not applicable |
58+
| `dueTS` | not applicable |
59+
| `changeCounter` | not applicable |
60+
61+
Only the properties supported in both old delta NS and new `moderationInfo` will be used for
62+
population of `@ns:com:here:mom:delta` namespace.
6163

6264
Pre MOM 10 delta NS
6365
model: https://docs.in.here.com/static/169823/1467398/html/#com/here/mom/internal/extension/branch/branch.html
@@ -67,8 +69,9 @@ info: https://here-dev.zoominsoftware.io/docs/bundle/map-object-model-data-speci
6769

6870
#### Populating old meta
6971

70-
Properties supported by both old `@ns:com:here:mom:meta` NS and MOM 10+ `meta` property
71-
- `sourceId`
72+
Properties supported by both old `@ns:com:here:mom:meta` NS and MOM 10+ `meta` property
73+
74+
- `sourceId`
7275
- `updatedByUser`
7376
- `lastUpdatedBy`
7477
- `modelVersion`

here-naksha-lib-mom10/src/jvmMain/java/com/here/naksha/mom10/Mom10Transformation.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@ public static void populatePreMom10Namespaces(@Nullable NakshaFeature feature) {
8888
}
8989

9090
public static void dropPreMom10Namespaces(@Nullable NakshaFeature feature) {
91-
NakshaProperties properties = feature.getProperties();
92-
properties.remove(NakshaProperties.META_KEY);
93-
properties.remove(NakshaProperties.DELTA_KEY);
91+
if(feature != null) {
92+
NakshaProperties properties = feature.getProperties();
93+
properties.remove(NakshaProperties.META_KEY);
94+
properties.remove(NakshaProperties.DELTA_KEY);
95+
}
9496
}
9597
}

here-naksha-lib-mom10/src/jvmTest/java/com/here/naksha/mom10/Mom10VerificationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ void shouldVerifyIfFeatureIsInMom10(VerificationCase verificationCase) {
2929
private static Stream<Named<VerificationCase>> shouldVerifyIfFeatureIsInMom10() {
3030
return Stream.of(
3131
named("10.0.0 version in correct field => true", new VerificationCase(featureWithVersionInMeta("10.0.0"), true)),
32-
named("10.0 version in correct field => true", new VerificationCase(featureWithVersionInMeta("10.0.0"), true)),
33-
named("10 version in correct field => true", new VerificationCase(featureWithVersionInMeta("10.0.0"), true)),
32+
named("10.0 version in correct field => false", new VerificationCase(featureWithVersionInMeta("10.0"), false)),
33+
named("10 version in correct field => false", new VerificationCase(featureWithVersionInMeta("10"), false)),
3434
named("10.0.1-lorem-ipsum version in correct field => true",
3535
new VerificationCase(featureWithVersionInMeta("10.0.1-lorem-ipsum"), true)),
3636
named("12.0.3 version in correct field => true", new VerificationCase(featureWithVersionInMeta("12.0.3"), true)),
@@ -39,7 +39,7 @@ private static Stream<Named<VerificationCase>> shouldVerifyIfFeatureIsInMom10()
3939
new VerificationCase(featureWithVersionInMeta("10.plus.1.equals.11-not_a_semver"), false)),
4040
named("10.0.0 version in incorrect field => false", new VerificationCase(featureWithVersionInOldMetaNs("10.0.0"), false)),
4141
named("Newer version in incorrect field => false", new VerificationCase(featureWithVersionInOldMetaNs("12.0.0"), false)),
42-
named("Older version in incorrect field => false", new VerificationCase(featureWithVersionInOldMetaNs("8.91"), false)),
42+
named("Older version in incorrect field => false", new VerificationCase(featureWithVersionInOldMetaNs("8.91.0"), false)),
4343
named("Invalid string in incorrect field => false",
4444
new VerificationCase(featureWithVersionInOldMetaNs("11.minus.2.equals.9"), false))
4545
);

0 commit comments

Comments
 (0)