@Test
public void shouldTalkToPluginToGetLatestModification() throws Exception {
String flyweight = "flyweight";
when(jsonMessageHandler.requestMessageForLatestRevision(scmPropertyConfiguration, materialData, flyweight)).thenReturn(requestBody);
MaterialPollResult deserializedResponse = new MaterialPollResult();
when(jsonMessageHandler.responseMessageForLatestRevision(responseBody)).thenReturn(deserializedResponse);
MaterialPollResult response = scmExtension.getLatestRevision(PLUGIN_ID, scmPropertyConfiguration, materialData, flyweight);
assertRequest(requestArgumentCaptor.getValue(), SCM_EXTENSION, "1.0", SCMExtension.REQUEST_LATEST_REVISION, requestBody);
verify(jsonMessageHandler).requestMessageForLatestRevision(scmPropertyConfiguration, materialData, flyweight);
verify(jsonMessageHandler).responseMessageForLatestRevision(responseBody);
assertSame(response, deserializedResponse);
}