Skip to content

Commit dac7871

Browse files
FieldLinkDefinition refactoring
1 parent 945fae0 commit dac7871

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

fields/src/test/java/network/aika/fields/manyobjects/OneToManyRelationTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515

1616
public class OneToManyRelationTest {
1717

18+
protected TypeRegistry registry;
1819
protected TestTypeOne typeA;
1920
protected TestTypeMany typeB;
2021

2122

2223
@BeforeEach
2324
public void init() {
24-
TypeRegistry registry = new TypeRegistryImpl();
25+
registry = new TypeRegistryImpl();
2526

2627
typeA = new TestTypeOne(registry, "A")
2728
.setClazz(TestObjectOne.class);
@@ -40,6 +41,7 @@ public void testInitFields() {
4041
.in(TEST_RELATION_FROM, fieldA)
4142
.in(TEST_RELATION_FROM, fieldB);
4243

44+
registry.flattenTypeHierarchy();
4345

4446
// Object and Field initialization
4547

fields/src/test/java/network/aika/fields/oneobject/FieldInstantiationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public void testMultiplication() {
108108
Obj o = new ObjImpl(type);
109109

110110
o.setFieldValue(a, 5.0);
111-
Assertions.assertNull(o.getField(c));
111+
Assertions.assertEquals(0.0, o.getField(c).getValue());
112112

113113
o.setFieldValue(b, 5.0);
114114

fields/src/test/java/network/aika/fields/oneobject/ObjectInstantiationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public void init() {
1414

1515
@Test
1616
public void testObjectInstantiation() {
17+
registry.flattenTypeHierarchy();
18+
1719
TestObject oa = typeA.instantiate();
1820

1921
Assertions.assertNotNull(oa);

0 commit comments

Comments
 (0)