Skip to content

Commit

Permalink
Merge branch 'useCaseDetection' of https://github.com/envimate/mapmate
Browse files Browse the repository at this point in the history
…into useCaseDetection
  • Loading branch information
envimate-opensource committed Dec 3, 2019
2 parents 356f4d4 + 507f2b1 commit 46da4a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -46,7 +46,7 @@ public static SerializationTracker serializationTracker() {
public void trackToProhibitCyclicReferences(final Object object) {
validateNotNull(object, "object");
final TrackedObject trackedObject = trackedObject(object);
if (this.visitedObjects.contains(trackedObject)) {
if (this.visitedObjects.contains(trackedObject) && false) { //TODO
throw circularReferenceException(object);
}
this.visitedObjects.add(trackedObject);
Expand Down
Expand Up @@ -22,6 +22,7 @@
package com.envimate.mapmate.specs;

import com.envimate.mapmate.domain.valid.*;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.util.Arrays;
Expand Down Expand Up @@ -173,6 +174,11 @@ public void givenCyclicType_whenSerializing_thenThrowsError() {
"of type com.envimate.mapmate.domain.valid.ACyclicType");
}

@Test
public void givenNoCyclicTypeWithMultipleReferencesToSameInstance_whenSerializing_thenPassesValidation() {
Assertions.fail("This test has yet to be invented");
}

@Test
public void givenNonCyclicType_whenSerializing_thenDoesNotThrowsError() {
final ACyclicType given1 = ACyclicType.deserialize(AString.fromStringValue("a"));
Expand Down

0 comments on commit 46da4a2

Please sign in to comment.