Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add java conventions plugin to fixture-monkey-tests #906

Merged
merged 1 commit into from
Jan 29, 2024
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
4 changes: 4 additions & 0 deletions fixture-monkey-tests/java-17-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id("com.navercorp.fixturemonkey.gradle.plugin.java-conventions")
}

java {
toolchain { languageVersion = JavaLanguageVersion.of(17) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.navercorp.fixturemonkey.FixtureMonkey;

class InterfaceDefaultMethodTest {
private final static FixtureMonkey SUT = FixtureMonkey.create();
private static final FixtureMonkey SUT = FixtureMonkey.create();

@RepeatedTest(TEST_COUNT)
void defaultMethod() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.junit.jupiter.api.RepeatedTest;

import com.navercorp.fixturemonkey.FixtureMonkey;
import com.navercorp.fixturemonkey.jackson.introspector.JacksonObjectArbitraryIntrospector;
import com.navercorp.fixturemonkey.jackson.plugin.JacksonPlugin;
import com.navercorp.fixturemonkey.tests.java17.RecordTestSpecs.ContainerRecord;
import com.navercorp.fixturemonkey.tests.java17.RecordTestSpecs.DateTimeRecord;
Expand Down
4 changes: 4 additions & 0 deletions fixture-monkey-tests/java-concurrent-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id("com.navercorp.fixturemonkey.gradle.plugin.java-conventions")
}

java {
toolchain { languageVersion = JavaLanguageVersion.of(17) }
}
Expand Down
4 changes: 4 additions & 0 deletions fixture-monkey-tests/java-tests/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id("com.navercorp.fixturemonkey.gradle.plugin.java-conventions")
}

dependencies {
testImplementation(project(":fixture-monkey-javax-validation"))
testImplementation("org.projectlombok:lombok:${Versions.LOMBOK}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import com.navercorp.fixturemonkey.javax.validation.plugin.JavaxValidationPlugin;
import com.navercorp.fixturemonkey.tests.java.AnonymousInstanceTestSpecs.AnnotatedInterface;
import com.navercorp.fixturemonkey.tests.java.AnonymousInstanceTestSpecs.ContainerInterface;
import com.navercorp.fixturemonkey.tests.java.AnonymousInstanceTestSpecs.DefaultMethodInterface;
import com.navercorp.fixturemonkey.tests.java.AnonymousInstanceTestSpecs.GetterInterface;
import com.navercorp.fixturemonkey.tests.java.AnonymousInstanceTestSpecs.InheritedInterface;
import com.navercorp.fixturemonkey.tests.java.AnonymousInstanceTestSpecs.InheritedInterfaceWithSameNameMethod;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public boolean isEmpty() {
}

@Override
public boolean contains(Object o) {
public boolean contains(Object object) {
return false;
}

Expand All @@ -154,37 +154,37 @@ public Object[] toArray() {
}

@Override
public <T> T[] toArray(T[] a) {
public <T> T[] toArray(T[] array) {
return null;
}

@Override
public boolean add(String s) {
public boolean add(String str) {
return false;
}

@Override
public boolean remove(Object o) {
public boolean remove(Object object) {
return false;
}

@Override
public boolean containsAll(Collection<?> c) {
public boolean containsAll(Collection<?> collection) {
return false;
}

@Override
public boolean addAll(Collection<? extends String> c) {
public boolean addAll(Collection<? extends String> collection) {
return false;
}

@Override
public boolean retainAll(Collection<?> c) {
public boolean retainAll(Collection<?> collection) {
return false;
}

@Override
public boolean removeAll(Collection<?> c) {
public boolean removeAll(Collection<?> collection) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,14 @@ public static class TypeBWithAnnotations implements TypeWithAnnotations {

@JsonTypeInfo(use = Id.NAME, include = As.WRAPPER_OBJECT)
@JsonSubTypes({
@JsonSubTypes.Type(value = TypeAWithAnnotationsIncludeWrapperObject.class, name = "TypeAWithAnnotationsIncludeWrapperObject"),
@JsonSubTypes.Type(value = TypeBWithAnnotationsIncludeWrapperObject.class, name = "TypeBWithAnnotationsIncludeWrapperObject")
@JsonSubTypes.Type(
value = TypeAWithAnnotationsIncludeWrapperObject.class,
name = "TypeAWithAnnotationsIncludeWrapperObject"
),
@JsonSubTypes.Type(
value = TypeBWithAnnotationsIncludeWrapperObject.class,
name = "TypeBWithAnnotationsIncludeWrapperObject"
)
})
public interface TypeWithAnnotationsIncludeWrapperObject {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import com.navercorp.fixturemonkey.tests.java.ImmutableJavaTestSpecs.ContainerObject;
import com.navercorp.fixturemonkey.tests.java.ImmutableJavaTestSpecs.Enum;
import com.navercorp.fixturemonkey.tests.java.ImmutableJavaTestSpecs.JavaTypeObject;
import com.navercorp.fixturemonkey.tests.java.ImmutableJavaTestSpecs.RootJavaTypeObject;
import com.navercorp.fixturemonkey.tests.java.JacksonSpecs.ConstructorObject;
import com.navercorp.fixturemonkey.tests.java.JacksonSpecs.JsonTypeInfoIdClass;
import com.navercorp.fixturemonkey.tests.java.JacksonSpecs.JsonTypeInfoIdName;
Expand Down Expand Up @@ -214,8 +213,10 @@ void fixedMapEntryType() {
@RepeatedTest(TEST_COUNT)
void sampleEnumKeyMap() {
thenNoException()
.isThrownBy(() -> SUT.giveMeBuilder(new TypeReference<List<Map<Enum, String>>>() {
})
.isThrownBy(() -> SUT.giveMeBuilder(
new TypeReference<List<Map<Enum, String>>>() {
}
)
.size("$", 2)
.sample()
);
Expand Down
Loading