package com.github.rschmitt.dynamicobject;

import org.junit.Test;

import java.lang.reflect.Method;
import java.util.Collection;

import static org.junit.Assert.*;

public class ReflectionTest {
    @Test
    public void fieldGetters() throws Exception {
        Collection<Method> methods = Reflection.fieldGetters(Type.class);

        assertEquals(2, methods.size());
        assertTrue(methods.contains(Type.class.getMethod("num")));
        assertTrue(methods.contains(Type.class.getMethod("customKey")));
    }

    @Test
    public void requiredFields() throws Exception {
        Collection<Method> methods = Reflection.requiredFields(Type.class);

        assertEquals(1, methods.size());
        assertTrue(methods.contains(Type.class.getMethod("num")));
    }
}

interface Type extends DynamicObject<Type> {
    @Required int num();
    @Key(":custom-key") String customKey();
    @Meta String someMetadata();

    Type num(int num);

    default void customMethod() {

    }

    default boolean anotherCustomMethod(int x) {
        return true;
    }
}

@@ -322,20 +322,30 @@
 Getters(
-Type
+VariousMethods
 .class);
@@ -418,36 +418,46 @@
 ethods.contains(
-Type
+VariousMethods
 .class.getMethod
@@ -496,36 +496,46 @@
 ethods.contains(
-Type
+VariousMethods
 .class.getMethod
@@ -688,20 +688,30 @@
 dFields(
-Type
+VariousMethods
 .class);
@@ -792,20 +792,30 @@
 ontains(
-Type
+VariousMethods
 .class.g
@@ -856,20 +856,30 @@
 terface 
-Type
+VariousMethods
  extends
@@ -893,20 +893,30 @@
 cObject%3C
-Type
+VariousMethods
 %3E %7B%0D%0A   
@@ -1027,12 +1027,22 @@
     
-Type
+VariousMethods
  num

Rename "Type" interface