Skip to content

Commit

Permalink
Add java conventions plugin to fixture-monkey-tests (#906)
Browse files Browse the repository at this point in the history
  • Loading branch information
SooKim1110 authored Jan 29, 2024
1 parent c4cedf6 commit 019c6e0
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 16 deletions.
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

0 comments on commit 019c6e0

Please sign in to comment.