I have the following config file..
*.*.HM.Evaluation.Types = { "key1" = "value1"; "key2" = "value2"; "key3" = "value3"; }; I have the following constructor injection...
@Inject public myConstuctor(@NonNull @Named("HM.Evaluation.Types") final Map<String , String> myMap) { ... } This Works when I run my code using
Properties myProperties = new Properties().load(new FileReader("myConfig.properties")); Names.BindProperties(Binder() , myProperties); When I test my code using JUnits, I am not able to bind a
Map< String,String> class The following code
Injector injector = Guice.CreateInjector((AbstractModule) -> { bind(Map.class) .annotatedWith(Names.named("HM.Evaluation.Types")).toInstance(DUMMP_MAP); }); gives me the following a google guice error
no implementation for java.lang.map< string , string> is found for the value Named(value = "HM.Evaluation.Types")
Is there a work around for this?