Skip to content

Commit 4285bb1

Browse files
committed
Create FilerProcessorTest.java
1 parent 23d40aa commit 4285bb1

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package io.microsphere.annotation.processor;
19+
20+
21+
import org.junit.jupiter.api.Test;
22+
23+
import javax.tools.JavaFileObject;
24+
25+
import static io.microsphere.annotation.processor.util.FilerUtils.exists;
26+
import static org.junit.jupiter.api.Assertions.assertNotNull;
27+
import static org.junit.jupiter.api.Assertions.assertTrue;
28+
29+
/**
30+
* {@link FilerProcessor} Test
31+
*
32+
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
33+
* @see ResourceProcessor
34+
* @since 1.0.0
35+
*/
36+
class FilerProcessorTest extends AbstractAnnotationProcessingTest {
37+
38+
private FilerProcessor processor;
39+
40+
@Override
41+
protected void beforeTest() {
42+
this.processor = new FilerProcessor(super.processingEnv);
43+
}
44+
45+
@Test
46+
void testProcessInFiler() {
47+
JavaFileObject sourceFile = processor.processInFiler(filer -> filer.createSourceFile("io.microsphere.annotation.processor.test.Test"));
48+
assertNotNull(sourceFile);
49+
assertTrue(exists(sourceFile));
50+
}
51+
}

0 commit comments

Comments
 (0)