Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ${package}

</#if>
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLParametrizedInput
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLRequestSerializer
import java.util.StringJoiner
<#if javaDoc?has_content>
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ open class ${className}()<#if implements?has_content> : <#list implements as int
return true</#if>
}

override fun hashCode(): Int = {
override fun hashCode(): Int {
<#if fields?has_content>
return Objects.hash(<#list fields as field>${field.name}<#if field_has_next>, </#if></#list>)
<#else>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package ${package}

</#if>
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLParametrizedInput
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLRequestSerializer
import scala.collection.JavaConverters._
<#if fields?has_content>
<#if enumImportItSelfInScala?has_content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,15 @@ void generate_SetGenerateClient_False() throws Exception {
outputBuildDir, mappingConfig, TestUtils.getStaticGeneratedInfo()).generate();

File[] files = Objects.requireNonNull(outputJavaClassesDir.listFiles());
List<String> generatedFileNames = Arrays.stream(files).map(File::getName).filter(f -> Objects.equals("Synchronized.scala", f)).sorted().collect(toList());
List<String> generatedFileNames = Arrays.stream(files).map(File::getName).filter(f -> Objects.equals("Synchronized.scala", f)
|| Objects.equals("QueryCaseParametrizedInput.scala", f)).sorted().collect(toList());
assertEquals(singletonList("Synchronized.scala"), generatedFileNames);

for (File file : files) {
if (Objects.equals("Synchronized.scala", file.getName())) {
if (Arrays.asList("QueryCaseParametrizedInput.scala", "Synchronized.scala").contains(file.getName())) {
assertSameTrimmedContent(
new File(String.format("src/test/resources/expected-classes/scala/tostring/%s.txt", "TOSTRING_Synchronized.scala")),
new File(String.format("src/test/resources/expected-classes/scala/tostring/%s.txt", "TOSTRING_Synchronized.scala",
"QueryCaseParametrizedInput")),
file);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ open class Commit(

}

override fun hashCode(): Int = {
override fun hashCode(): Int {
return Objects.hash(abbreviatedOid, additions, associatedPullRequests, author, authoredByCommitter, authoredDate, blame, changedFiles, comments, commitResourcePath, commitUrl, committedDate, committedViaWeb, committer, deletions, deployments, history, id, message, messageBody, messageBodyHTML, messageHeadline, messageHeadlineHTML, oid, parents, pushedDate, repository, resourcePath, signature, status, tarballUrl, tree, treeResourcePath, treeUrl, url, viewerCanSubscribe, viewerSubscription, zipballUrl)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kobylynskyi.graphql.codegen.prot

import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLParametrizedInput
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLRequestSerializer
import java.util.StringJoiner
/**
* Parametrized input for field fun in type Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kobylynskyi.graphql.codegen.prot

import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLParametrizedInput
import com.kobylynskyi.graphql.codegen.model.graphql.GraphQLRequestSerializer
import scala.collection.JavaConverters._
import TestEnum._

Expand Down