From 7939c81f0adf32a73672a200594dc7161f86f8a7 Mon Sep 17 00:00:00 2001 From: Ludovic Motte Date: Sun, 3 Feb 2019 14:38:49 +0100 Subject: [PATCH 1/2] fix test : @EmbeddedId share same where syntax than @Embedded --- .../graphql/jpa/query/schema/GraphQLExecutorTests.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/graphql-jpa-query-schema/src/test/java/com/introproventures/graphql/jpa/query/schema/GraphQLExecutorTests.java b/graphql-jpa-query-schema/src/test/java/com/introproventures/graphql/jpa/query/schema/GraphQLExecutorTests.java index 2266e32f2..0a80d6ce5 100644 --- a/graphql-jpa-query-schema/src/test/java/com/introproventures/graphql/jpa/query/schema/GraphQLExecutorTests.java +++ b/graphql-jpa-query-schema/src/test/java/com/introproventures/graphql/jpa/query/schema/GraphQLExecutorTests.java @@ -362,7 +362,7 @@ public void queryForEntityWithMappedSuperclass() { // https://github.com/introproventures/graphql-jpa-query/issues/30 @Test - public void queryForEntityWithEmeddableType() { + public void queryForEntityWithEmbeddedIdAndEmbeddedField() { //given String query = "{ Boat(boatId: {id: \"1\" country: \"EN\"}) { boatId {id country} engine { identification } } }"; @@ -376,7 +376,7 @@ public void queryForEntityWithEmeddableType() { } @Test - public void queryForEntityWithEmeddableTypeAndWhere() { + public void queryForEntityWithEmbeddedFieldWithWhere() { //given String query = "{ Boats { select { boatId {id country} engine(where: { identification: { EQ: \"12345\"}}) { identification } } } }"; @@ -390,9 +390,9 @@ public void queryForEntityWithEmeddableTypeAndWhere() { } @Test - public void queryForEntitiesWithEmeddableTypeAndWhereEmbeddableId() { + public void queryForEntitiesWithWithEmbeddedIdWithWhere() { //given - String query = "{ Boats(where: {boatId: {EQ: {id: \"1\" country: \"EN\"}}}) { select { boatId {id country} engine { identification } } } }"; + String query = "{ Boats { select { boatId(where: { AND: {id: { LIKE: \"1\"} country: { EQ: \"EN\"}}}) {id country} engine { identification } } } }"; String expected = "{Boats={select=[{boatId={id=1, country=EN}, engine={identification=12345}}]}}"; @@ -402,5 +402,5 @@ public void queryForEntitiesWithEmeddableTypeAndWhereEmbeddableId() { // then assertThat(result.toString()).isEqualTo(expected); } - + } \ No newline at end of file From e9f854aaf36c2569fdd8222074a425f4b41bdafd Mon Sep 17 00:00:00 2001 From: Ludovic Motte Date: Sun, 10 Feb 2019 18:17:19 +0100 Subject: [PATCH 2/2] test : remove explicit AND as it is implicit by default --- .../graphql/jpa/query/schema/GraphQLExecutorTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphql-jpa-query-schema/src/test/java/com/introproventures/graphql/jpa/query/schema/GraphQLExecutorTests.java b/graphql-jpa-query-schema/src/test/java/com/introproventures/graphql/jpa/query/schema/GraphQLExecutorTests.java index 0a80d6ce5..642a37c51 100644 --- a/graphql-jpa-query-schema/src/test/java/com/introproventures/graphql/jpa/query/schema/GraphQLExecutorTests.java +++ b/graphql-jpa-query-schema/src/test/java/com/introproventures/graphql/jpa/query/schema/GraphQLExecutorTests.java @@ -392,7 +392,7 @@ public void queryForEntityWithEmbeddedFieldWithWhere() { @Test public void queryForEntitiesWithWithEmbeddedIdWithWhere() { //given - String query = "{ Boats { select { boatId(where: { AND: {id: { LIKE: \"1\"} country: { EQ: \"EN\"}}}) {id country} engine { identification } } } }"; + String query = "{ Boats { select { boatId(where: { id: { LIKE: \"1\"} country: { EQ: \"EN\"}}) {id country} engine { identification } } } }"; String expected = "{Boats={select=[{boatId={id=1, country=EN}, engine={identification=12345}}]}}";