Removed cross compilation
This commit is contained in:
@@ -1662,7 +1662,7 @@ following code listing shows the `SingleTestGenerator` interface:
|
||||
|
||||
[source,groovy]
|
||||
----
|
||||
include::{verifier_core_path}/src/main/groovy/org/springframework/cloud/contract/verifier/builder/SingleTestGenerator.java[indent=0,lines=17..-1]
|
||||
include::{verifier_core_path}/src/main/groovy/org/springframework/cloud/contract/verifier/builder/SingleTestGenerator.groovy[indent=0,lines=17..-1]
|
||||
----
|
||||
|
||||
Again, you must provide a `spring.factories` file, such as the one shown in the following
|
||||
|
||||
@@ -209,13 +209,8 @@
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>addSources</goal>
|
||||
<goal>addTestSources</goal>
|
||||
<goal>generateStubs</goal>
|
||||
<goal>compile</goal>
|
||||
<goal>generateTestStubs</goal>
|
||||
<goal>compileTests</goal>
|
||||
<goal>removeStubs</goal>
|
||||
<goal>removeTestStubs</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* Licensed under the Apache License, Version 2.0 (the "License")
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
@@ -14,34 +14,34 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.contract.verifier.builder;
|
||||
package org.springframework.cloud.contract.verifier.builder
|
||||
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
* @since
|
||||
*/
|
||||
class GeneratedClassDataForMethod {
|
||||
final SingleTestGenerator.GeneratedClassData generatedClassData;
|
||||
final String methodName;
|
||||
final SingleTestGenerator.GeneratedClassData generatedClassData
|
||||
final String methodName
|
||||
|
||||
GeneratedClassDataForMethod(SingleTestGenerator.GeneratedClassData generatedClassData,
|
||||
String methodName) {
|
||||
this.generatedClassData = generatedClassData;
|
||||
this.methodName = methodName;
|
||||
this.generatedClassData = generatedClassData
|
||||
this.methodName = methodName
|
||||
}
|
||||
|
||||
private SingleTestGenerator.GeneratedClassData assertClassData() {
|
||||
if (this.generatedClassData == null) {
|
||||
throw new IllegalStateException("No metadata was found for the generated test class");
|
||||
throw new IllegalStateException("No metadata was found for the generated test class")
|
||||
}
|
||||
return this.generatedClassData;
|
||||
return this.generatedClassData
|
||||
}
|
||||
|
||||
String className() {
|
||||
return assertClassData().className;
|
||||
return assertClassData().className
|
||||
}
|
||||
|
||||
java.nio.file.Path testClassPath() {
|
||||
return assertClassData().testClassPath;
|
||||
return assertClassData().testClassPath
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
package org.springframework.cloud.contract.verifier.builder;
|
||||
package org.springframework.cloud.contract.verifier.builder
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.springframework.cloud.contract.verifier.config.ContractVerifierConfigProperties;
|
||||
import org.springframework.cloud.contract.verifier.file.ContractMetadata;
|
||||
import org.springframework.cloud.contract.verifier.config.ContractVerifierConfigProperties
|
||||
import org.springframework.cloud.contract.verifier.file.ContractMetadata
|
||||
|
||||
/**
|
||||
* Builds a single test.
|
||||
*
|
||||
* @since 1.1.0
|
||||
*/
|
||||
public interface SingleTestGenerator {
|
||||
trait SingleTestGenerator {
|
||||
|
||||
/**
|
||||
* Creates contents of a single test class in which all test scenarios from
|
||||
* the contract metadata should be placed.
|
||||
@@ -24,8 +24,8 @@ public interface SingleTestGenerator {
|
||||
* @deprecated use {@link SingleTestGenerator#buildClass(ContractVerifierConfigProperties, Collection, String, GeneratedClassData)}
|
||||
*/
|
||||
@Deprecated
|
||||
String buildClass(ContractVerifierConfigProperties properties,
|
||||
Collection<ContractMetadata> listOfFiles, String className, String classPackage, String includedDirectoryRelativePath);
|
||||
abstract String buildClass(ContractVerifierConfigProperties properties,
|
||||
Collection<ContractMetadata> listOfFiles, String className, String classPackage, String includedDirectoryRelativePath)
|
||||
|
||||
/**
|
||||
* Creates contents of a single test class in which all test scenarios from
|
||||
@@ -37,9 +37,9 @@ public interface SingleTestGenerator {
|
||||
* @param includedDirectoryRelativePath - relative path to the included directory
|
||||
* @return contents of a single test class
|
||||
*/
|
||||
default String buildClass(ContractVerifierConfigProperties properties,
|
||||
String buildClass(ContractVerifierConfigProperties properties,
|
||||
Collection<ContractMetadata> listOfFiles, String includedDirectoryRelativePath, GeneratedClassData generatedClassData) {
|
||||
return buildClass(properties, listOfFiles, generatedClassData.className, generatedClassData.classPackage, includedDirectoryRelativePath);
|
||||
return buildClass(properties, listOfFiles, generatedClassData.className, generatedClassData.classPackage, includedDirectoryRelativePath)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,18 +47,18 @@ public interface SingleTestGenerator {
|
||||
*
|
||||
* @param properties - properties passed to the plugin
|
||||
*/
|
||||
String fileExtension(ContractVerifierConfigProperties properties);
|
||||
abstract String fileExtension(ContractVerifierConfigProperties properties)
|
||||
|
||||
class GeneratedClassData {
|
||||
public final String className;
|
||||
public final String classPackage;
|
||||
public final java.nio.file.Path testClassPath;
|
||||
static class GeneratedClassData {
|
||||
public final String className
|
||||
public final String classPackage
|
||||
public final java.nio.file.Path testClassPath
|
||||
|
||||
public GeneratedClassData(String className, String classPackage,
|
||||
GeneratedClassData(String className, String classPackage,
|
||||
java.nio.file.Path testClassPath) {
|
||||
this.className = className;
|
||||
this.classPackage = classPackage;
|
||||
this.testClassPath = testClassPath;
|
||||
this.className = className
|
||||
this.classPackage = classPackage
|
||||
this.testClassPath = testClassPath
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user