MavenVariableResolverAdapter extends VariableResolverAdapterSupport { @Override protected void addFromRequest(final VariableSourceBuilder builder, final Request request) { addMavenCoordinates(builder, request.getPath()); } @Inject  MavenVariableResolverAdapter(@Named(Maven2Format.NAME) final MavenPathParser mavenPathParser);   }
@Test public void addFromRequestShouldAddCoordinatesToVariableSourceBuilder() { mavenVariableResolverAdapter.addFromRequest(builder, request); verifyCoordinatesSet(); }
@Test public void addFromRequestShouldNotAddNullCoordinates() { when(mavenPath.getCoordinates()).thenReturn(null); mavenVariableResolverAdapter.addFromRequest(builder, request); verify(builder, never()).addResolver(any(VariableResolver.class)); }