File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
src/test/java/com/kobylynskyi/graphql/codegen/supplier Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .kobylynskyi .graphql .codegen .supplier ;
2+
3+ import com .kobylynskyi .graphql .codegen .model .MappingConfig ;
4+ import org .junit .jupiter .api .Test ;
5+
6+ import static org .junit .jupiter .api .Assertions .*;
7+
8+ class JsonMappingConfigSupplierTest {
9+
10+ @ Test
11+ void loadCorrect () {
12+ MappingConfig externalMappingConfig = new JsonMappingConfigSupplier ("src/test/resources/json/mappingconfig.json" ).get ();
13+ assertEquals (externalMappingConfig .getPackageName (), "com.kobylynskyi.graphql.testconfigjson" );
14+ assertEquals (externalMappingConfig .getGenerateApis (), true );
15+ assertEquals (externalMappingConfig .getCustomTypesMapping ().get ("Price.amount" ), "java.math.BigDecimal" );
16+ assertNull (externalMappingConfig .getApiPackageName ());
17+ }
18+
19+ @ Test
20+ void loadNull () {
21+ assertNull (new JsonMappingConfigSupplier (null ).get ());
22+ }
23+
24+ @ Test
25+ void loadInvalid () {
26+ assertThrows (IllegalArgumentException .class , () -> new JsonMappingConfigSupplier ("blah.json" ).get ());
27+ }
28+
29+ }
You can’t perform that action at this time.
0 commit comments