Q:

Capture Entity argument to webtarget.request.put in with mockito

I'm trying to capture an argument passed to my webtarget. But IntelliJ keeps telling me it is wrong
aren't you able to capture the Entity.class or am I doing it wrong?
Code snippet
private WebTarget webTarget;

response = target.request("application/hal+json").put(Entity.entity(inputString, MediaType.APPLICATION_JSON_TYPE));

My test
@RunWith(MockitoJUnitRunner.class)
public class ConnectorClientTest {

    @Mock
    WebTarget webTarget;

    @Mock
    Invocation.Builder builder;

    @InjectMocks
    ConnectorClient connectorClient;

    @Before
    public void setUp() throws Exception {
        Response response = null;
        when(webTarget.path(any())).thenReturn(webTarget);
        when(webTarget.path(any())).thenReturn(webTarget);
        when(webTarget.request(anyString())).thenReturn(builder);
        when(builder.put(any(Entity.class)))
            .thenReturn(response);
    }

        @Test
        public void initiatePropertyIdentifierSearchTest(){

        PropertyIdentifierSearchInput input = new 
        PropertyIdentifierSearchInput("12345670", BigInteger.valueOf(123));

        connectorClient.initiatePropertyIdentifierSearch(input);
        ArgumentCaptor<Entity> argument = ArgumentCaptor.forClass(Entity.class);
        verify(webTarget.request((String[]) 
        Mockito.any()).put(argument.capture()));
        Entity entity = argument.getValue();
        //assert the entity

    }

A:

The verify line is wrong. You have to verify the builder:
verify(builder).put(argument.capture()); 

