>  
>  public abstract class BaseProfitBricksRequestBinder<T> implements MapBinder {
>  
> +   protected final String endpointPath = "/rest/v2";

In fact that is not a good option, as when building the context, jclouds 
substitutes several values and properties from the metadata based on the 
properties passed to the context builder (it is not a use case right now here, 
but even when the provider metadata sets the endpoint users can override it 
when creating the context)., so you really need to use the injection approach 
to inject the right endpoint.

Please change the constructor back to inject the `@Provider Supplier<URI> 
endpointSupplier`. Regarding the test, I've had a look and there is no need to 
configure the `LocationModule`; just binding the supplier used in the base 
binder class is enough:

```java
Injector injector = Guice.createInjector(new GsonModule(), new AbstractModule() 
{
   @Override protected void configure() {
      bind(new TypeLiteral<Supplier<URI>>() {
      }).annotatedWith(Provider.class).toInstance(
         Suppliers.ofInstance(URI.create(new 
ProfitBricksProviderMetadata().getEndpoint())));
      }
   });
```
I've applied the injection approach and configured the 
`UpdateImageRequestBinderTest` like this and tests passed. Could you apply the 
same pattern to the rest of the tests?

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/245/files#r56144598

Reply via email to