Skip to content

Commit

Permalink
Rename tests (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnawf authored Dec 5, 2024
1 parent f461a41 commit 0025f15
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 45 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package graphql.nadel.tests.next.fixtures.hydration.copy
package graphql.nadel.tests.next.fixtures.hydration

import graphql.nadel.Nadel
import graphql.nadel.NadelExecutionHints
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
// @formatter:off
package graphql.nadel.tests.next.fixtures.hydration.copy
package graphql.nadel.tests.next.fixtures.hydration

import graphql.nadel.tests.next.ExpectedNadelResult
import graphql.nadel.tests.next.ExpectedServiceCall
import graphql.nadel.tests.next.TestSnapshot
import graphql.nadel.tests.next.listOfJsonStrings
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.listOf

private suspend fun main() {
graphql.nadel.tests.next.update<HydrationRemainingArgumentsTest>()
Expand All @@ -21,9 +17,9 @@ private suspend fun main() {
@Suppress("unused")
public class HydrationRemainingArgumentsTestSnapshot : TestSnapshot() {
override val calls: List<ExpectedServiceCall> = listOf(
ExpectedServiceCall(
service = "graph_store",
query = """
ExpectedServiceCall(
service = "graph_store",
query = """
| query (${'$'}v0: JSON) {
| graphStore_query(query: "SELECT * FROM Work WHERE teamId = ?", remainingArgs: ${'$'}v0) {
| __typename
Expand All @@ -34,15 +30,15 @@ public class HydrationRemainingArgumentsTestSnapshot : TestSnapshot() {
| }
| }
""".trimMargin(),
variables = """
variables = """
| {
| "v0": {
| "orgId": "turtles",
| "teamId": null
| }
| }
""".trimMargin(),
result = """
result = """
| {
| "data": {
| "graphStore_query": {
Expand All @@ -57,12 +53,12 @@ public class HydrationRemainingArgumentsTestSnapshot : TestSnapshot() {
| }
| }
""".trimMargin(),
delayedResults = listOfJsonStrings(
),
delayedResults = listOfJsonStrings(
),
ExpectedServiceCall(
service = "jira",
query = """
),
ExpectedServiceCall(
service = "jira",
query = """
| {
| issuesByIds(ids: ["ari:cloud:jira::issue/1"]) {
| __typename
Expand All @@ -71,8 +67,8 @@ public class HydrationRemainingArgumentsTestSnapshot : TestSnapshot() {
| }
| }
""".trimMargin(),
variables = " {}",
result = """
variables = " {}",
result = """
| {
| "data": {
| "issuesByIds": [
Expand All @@ -85,10 +81,10 @@ public class HydrationRemainingArgumentsTestSnapshot : TestSnapshot() {
| }
| }
""".trimMargin(),
delayedResults = listOfJsonStrings(
),
delayedResults = listOfJsonStrings(
),
)
),
)

/**
* ```json
Expand All @@ -110,7 +106,7 @@ public class HydrationRemainingArgumentsTestSnapshot : TestSnapshot() {
* ```
*/
override val result: ExpectedNadelResult = ExpectedNadelResult(
result = """
result = """
| {
| "data": {
| "businessReport_findRecentWorkByTeam": {
Expand All @@ -127,7 +123,7 @@ public class HydrationRemainingArgumentsTestSnapshot : TestSnapshot() {
| }
| }
""".trimMargin(),
delayedResults = listOfJsonStrings(
),
)
delayedResults = listOfJsonStrings(
),
)
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package graphql.nadel.tests.next.fixtures.hydration.copy
package graphql.nadel.tests.next.fixtures.hydration.statics

import graphql.nadel.Nadel
import graphql.nadel.NadelExecutionHints
Expand All @@ -13,7 +13,7 @@ import graphql.nadel.tests.next.NadelIntegrationTest
/**
* Uses hydration to "copy" a field. Does not link two pieces of data together i.e. no $source fields used.
*/
class HydrationCopiesFieldAndHasPolymorphicHydrationTest : NadelIntegrationTest(
class StaticHydrationAndPolymorphicHydrationTest : NadelIntegrationTest(
query = """
query {
businessReport_findRecentWorkByTeam(teamId: "hello") {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @formatter:off
package graphql.nadel.tests.next.fixtures.hydration.copy
package graphql.nadel.tests.next.fixtures.hydration.statics

import graphql.nadel.tests.next.ExpectedNadelResult
import graphql.nadel.tests.next.ExpectedServiceCall
Expand All @@ -10,7 +10,7 @@ import kotlin.collections.List
import kotlin.collections.listOf

private suspend fun main() {
graphql.nadel.tests.next.update<HydrationCopiesFieldAndHasPolymorphicHydrationTest>()
graphql.nadel.tests.next.update<StaticHydrationAndPolymorphicHydrationTest>()
}

/**
Expand All @@ -19,7 +19,7 @@ private suspend fun main() {
* Refer to [graphql.nadel.tests.next.UpdateTestSnapshots
*/
@Suppress("unused")
public class HydrationCopiesFieldAndHasPolymorphicHydrationTestSnapshot : TestSnapshot() {
public class StaticHydrationAndPolymorphicHydrationTestSnapshot : TestSnapshot() {
override val calls: List<ExpectedServiceCall> = listOf(
ExpectedServiceCall(
service = "bitbucket",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package graphql.nadel.tests.next.fixtures.hydration.copy
package graphql.nadel.tests.next.fixtures.hydration.statics

import graphql.nadel.NadelExecutionHints
import graphql.nadel.tests.next.NadelIntegrationTest

class HydrationCopiesScalarFieldTest : NadelIntegrationTest(
class StaticHydrationScalarFieldTest : NadelIntegrationTest(
query = """
query {
copyField(id: "wow")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @formatter:off
package graphql.nadel.tests.next.fixtures.hydration.copy
package graphql.nadel.tests.next.fixtures.hydration.statics

import graphql.nadel.tests.next.ExpectedNadelResult
import graphql.nadel.tests.next.ExpectedServiceCall
Expand All @@ -10,7 +10,7 @@ import kotlin.collections.List
import kotlin.collections.listOf

private suspend fun main() {
graphql.nadel.tests.next.update<HydrationCopiesScalarFieldTest>()
graphql.nadel.tests.next.update<StaticHydrationScalarFieldTest>()
}

/**
Expand All @@ -19,7 +19,7 @@ private suspend fun main() {
* Refer to [graphql.nadel.tests.next.UpdateTestSnapshots
*/
@Suppress("unused")
public class HydrationCopiesScalarFieldTestSnapshot : TestSnapshot() {
public class StaticHydrationScalarFieldTestSnapshot : TestSnapshot() {
override val calls: List<ExpectedServiceCall> = listOf(
ExpectedServiceCall(
service = "graph_store",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package graphql.nadel.tests.next.fixtures.hydration.copy
package graphql.nadel.tests.next.fixtures.hydration.statics

import graphql.nadel.NadelExecutionHints
import graphql.nadel.engine.util.strictAssociateBy
Expand All @@ -7,7 +7,7 @@ import graphql.nadel.tests.next.NadelIntegrationTest
/**
* Uses hydration to "copy" a field. Does not link two pieces of data together i.e. no $source fields used.
*/
class HydrationCopiesFieldTest : NadelIntegrationTest(
class StaticHydrationTest : NadelIntegrationTest(
query = """
query {
businessReport_findRecentWorkByTeam(teamId: "hello") {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @formatter:off
package graphql.nadel.tests.next.fixtures.hydration.copy
package graphql.nadel.tests.next.fixtures.hydration.statics

import graphql.nadel.tests.next.ExpectedNadelResult
import graphql.nadel.tests.next.ExpectedServiceCall
Expand All @@ -10,7 +10,7 @@ import kotlin.collections.List
import kotlin.collections.listOf

private suspend fun main() {
graphql.nadel.tests.next.update<HydrationCopiesFieldTest>()
graphql.nadel.tests.next.update<StaticHydrationTest>()
}

/**
Expand All @@ -19,7 +19,7 @@ private suspend fun main() {
* Refer to [graphql.nadel.tests.next.UpdateTestSnapshots
*/
@Suppress("unused")
public class HydrationCopiesFieldTestSnapshot : TestSnapshot() {
public class StaticHydrationTestSnapshot : TestSnapshot() {
override val calls: List<ExpectedServiceCall> = listOf(
ExpectedServiceCall(
service = "graph_store",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package graphql.nadel.tests.next.fixtures.hydration.copy
package graphql.nadel.tests.next.fixtures.hydration.statics

import graphql.nadel.NadelExecutionHints
import graphql.nadel.engine.util.strictAssociateBy
Expand All @@ -7,7 +7,7 @@ import graphql.nadel.tests.next.NadelIntegrationTest
/**
* Tests what happens if the virtual types hint is off.
*/
class HydrationCopiesFieldHintOffTest : NadelIntegrationTest(
class StaticHydrationVirtualTypeHintOffTest : NadelIntegrationTest(
query = """
query {
businessReport_findRecentWorkByTeam(teamId: "hello") {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @formatter:off
package graphql.nadel.tests.next.fixtures.hydration.copy
package graphql.nadel.tests.next.fixtures.hydration.statics

import graphql.nadel.tests.next.ExpectedNadelResult
import graphql.nadel.tests.next.ExpectedServiceCall
Expand All @@ -10,7 +10,7 @@ import kotlin.collections.List
import kotlin.collections.listOf

private suspend fun main() {
graphql.nadel.tests.next.update<HydrationCopiesFieldHintOffTest>()
graphql.nadel.tests.next.update<StaticHydrationVirtualTypeHintOffTest>()
}

/**
Expand All @@ -19,7 +19,7 @@ private suspend fun main() {
* Refer to [graphql.nadel.tests.next.UpdateTestSnapshots
*/
@Suppress("unused")
public class HydrationCopiesFieldHintOffTestSnapshot : TestSnapshot() {
public class StaticHydrationVirtualTypeHintOffTestSnapshot : TestSnapshot() {
override val calls: List<ExpectedServiceCall> = listOf(
ExpectedServiceCall(
service = "graph_store",
Expand Down

0 comments on commit 0025f15

Please sign in to comment.