File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
core/src/test/java/org/neo4j/gds/api/schema
graph-schema-api/src/main/java/org/neo4j/gds/api/schema Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 3434
3535import static org .assertj .core .api .Assertions .assertThat ;
3636import static org .junit .jupiter .api .Assertions .assertEquals ;
37+ import static org .junit .jupiter .api .Assertions .assertFalse ;
3738import static org .junit .jupiter .api .Assertions .assertThrows ;
3839import static org .junit .jupiter .api .Assertions .assertTrue ;
3940
4041class NodeSchemaTest {
4142
43+ @ Test
44+ void handlesOutsideOfSchemaRequests () {
45+ NodeSchema empty = NodeSchema .builder ().build ();
46+ assertFalse (empty .hasProperty (NodeLabel .of ("NotInSchema" ), "notInSchemaEither" ));
47+ }
48+
4249 @ Test
4350 void testDefaultValues () {
4451 var label = NodeLabel .of ("Foo" );
Original file line number Diff line number Diff line change 3434
3535import static org .assertj .core .api .Assertions .assertThat ;
3636import static org .junit .jupiter .api .Assertions .assertEquals ;
37+ import static org .junit .jupiter .api .Assertions .assertFalse ;
3738import static org .junit .jupiter .api .Assertions .assertThrows ;
3839import static org .junit .jupiter .api .Assertions .assertTrue ;
3940
4041class RelationshipSchemaTest {
4142
43+ @ Test
44+ void handlesOutsideOfSchemaRequests () {
45+ var empty = RelationshipSchema .builder ().build ();
46+ assertFalse (empty .hasProperty (RelationshipType .of ("NotInSchema" ), "notInSchemaEither" ));
47+ }
48+
4249 @ Test
4350 void testDefaultValuesAndAggregation () {
4451 var relType = RelationshipType .of ("BAR" );
Original file line number Diff line number Diff line change @@ -59,7 +59,9 @@ default boolean hasProperties(ELEMENT_IDENTIFIER elementIdentifier) {
5959
6060 @ Value .Default
6161 default boolean hasProperty (ELEMENT_IDENTIFIER elementIdentifier , String propertyKey ) {
62- return (!properties ().get (elementIdentifier ).isEmpty () && properties ().get (elementIdentifier ).containsKey (propertyKey ));
62+ return properties ().containsKey (elementIdentifier ) && (!properties ()
63+ .get (elementIdentifier )
64+ .isEmpty () && properties ().get (elementIdentifier ).containsKey (propertyKey ));
6365 }
6466
6567 @ Value .Default
You can’t perform that action at this time.
0 commit comments