|
|
|
@ -12,10 +12,12 @@ import javax.lang.model.element.TypeElement; |
|
|
|
|
|
|
|
|
|
|
|
import org.junit.jupiter.api.BeforeEach; |
|
|
|
import org.junit.jupiter.api.BeforeEach; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
|
|
|
import org.junit.jupiter.api.extension.ExtendWith; |
|
|
|
import org.mockito.ArgumentMatchers; |
|
|
|
import org.mockito.ArgumentMatchers; |
|
|
|
import org.mockito.Mock; |
|
|
|
import org.mockito.Mock; |
|
|
|
import org.mockito.MockitoAnnotations; |
|
|
|
import org.mockito.junit.jupiter.MockitoExtension; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ExtendWith(MockitoExtension.class) |
|
|
|
public class Property2JavaGeneratorTest { |
|
|
|
public class Property2JavaGeneratorTest { |
|
|
|
|
|
|
|
|
|
|
|
private Property2JavaGenerator processor; |
|
|
|
private Property2JavaGenerator processor; |
|
|
|
@ -29,7 +31,6 @@ public class Property2JavaGeneratorTest { |
|
|
|
|
|
|
|
|
|
|
|
@BeforeEach |
|
|
|
@BeforeEach |
|
|
|
void initProcesor() { |
|
|
|
void initProcesor() { |
|
|
|
MockitoAnnotations.initMocks(this); |
|
|
|
|
|
|
|
annotations = new HashSet<>(); |
|
|
|
annotations = new HashSet<>(); |
|
|
|
|
|
|
|
|
|
|
|
processor = new Property2JavaGenerator(); |
|
|
|
processor = new Property2JavaGenerator(); |
|
|
|
@ -37,6 +38,7 @@ public class Property2JavaGeneratorTest { |
|
|
|
when(processingEnv.getMessager()).thenReturn(messanger); |
|
|
|
when(processingEnv.getMessager()).thenReturn(messanger); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void testGeneratorInitializedCorrectly() { |
|
|
|
void testGeneratorInitializedCorrectly() { |
|
|
|
when(roundEnv.getElementsAnnotatedWith(ArgumentMatchers.any(Class.class))).thenReturn(annotations); |
|
|
|
when(roundEnv.getElementsAnnotatedWith(ArgumentMatchers.any(Class.class))).thenReturn(annotations); |
|
|
|
|