Skip to content

Commit

Permalink
remove duplicate class name
Browse files Browse the repository at this point in the history
  • Loading branch information
evanchooly committed Aug 19, 2024
1 parent 18c3113 commit 62a9c4d
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions core/src/test/java/dev/morphia/test/TestDiscriminatorLookup.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package dev.morphia.test;

import dev.morphia.annotations.Entity;
import dev.morphia.test.models.Shape;
import dev.morphia.test.models.Square;
import dev.morphia.test.models.TestEntity;

import org.testng.annotations.Test;
Expand All @@ -14,14 +16,14 @@ public class TestDiscriminatorLookup extends TestBase {
public void testLookup() {
withConfig(buildConfig(SomeEntity.class), () -> {
final SomeEntity entity = new SomeEntity();
entity.setShape(new Shape.Square());
entity.setShape(new Square());

getDs().save(entity);
});

final SomeEntity entity = getDs().find(SomeEntity.class).first();
assertNotNull(entity);
assertTrue(Shape.Square.class.isInstance(entity.getShape()));
assertTrue(Square.class.isInstance(entity.getShape()));
}

@Entity
Expand All @@ -36,11 +38,4 @@ public void setShape(Shape shape) {
this.shape = shape;
}
}

@Entity
public static abstract class Shape {
public static class Square extends Shape {
public double side;
}
}
}

0 comments on commit 62a9c4d

Please sign in to comment.