@Test public void testActionPostRequestXmlScore() throws UnsupportedEncodingException, ODataUriParseException { String uri = "http: odataUri = uriParser.parseUri(uri, entityDataModel); int score = unmarshaller.score(createODataRequestContext( createODataRequest(POST, CONTENT_TYPE_XML), odataUri, entityDataModel)); assertThat(score, is(50)); }
@Override public int score(ODataRequestContext requestContext) { if (isRightMethodForUnmarshall(requestContext.getRequest()) && ODataUriUtil.isActionCallUri(requestContext.getUri())) { MediaType contentType = requestContext.getRequest().getContentType(); int baseScore = super.score(contentType, MediaType.JSON); int actionScore = baseScore + ACTION_OPERATION_SCORE; LOG.debug("Match for JsonActionUnmarshaller: {} with score: {}", requestContext.getRequest(), actionScore); return actionScore; } return DEFAULT_SCORE; }
JsonActionUnmarshaller extends AbstractUnmarshaller { @Override public int score(ODataRequestContext requestContext) { if (isRightMethodForUnmarshall(requestContext.getRequest()) && ODataUriUtil.isActionCallUri(requestContext.getUri())) { MediaType contentType = requestContext.getRequest().getContentType(); int baseScore = super.score(contentType, MediaType.JSON); int actionScore = baseScore + ACTION_OPERATION_SCORE; LOG.debug("Match for JsonActionUnmarshaller: {} with score: {}", requestContext.getRequest(), actionScore); return actionScore; } return DEFAULT_SCORE; } }
JsonActionUnmarshaller extends AbstractUnmarshaller { @Override public int score(ODataRequestContext requestContext) { if (isRightMethodForUnmarshall(requestContext.getRequest()) && ODataUriUtil.isActionCallUri(requestContext.getUri())) { MediaType contentType = requestContext.getRequest().getContentType(); int baseScore = super.score(contentType, MediaType.JSON); int actionScore = baseScore + ACTION_OPERATION_SCORE; LOG.debug("Match for JsonActionUnmarshaller: {} with score: {}", requestContext.getRequest(), actionScore); return actionScore; } return DEFAULT_SCORE; }  }
JsonActionUnmarshaller extends AbstractUnmarshaller { @Override public int score(ODataRequestContext requestContext) { if (isRightMethodForUnmarshall(requestContext.getRequest()) && ODataUriUtil.isActionCallUri(requestContext.getUri())) { MediaType contentType = requestContext.getRequest().getContentType(); int baseScore = super.score(contentType, MediaType.JSON); int actionScore = baseScore + ACTION_OPERATION_SCORE; LOG.debug("Match for JsonActionUnmarshaller: {} with score: {}", requestContext.getRequest(), actionScore); return actionScore; } return DEFAULT_SCORE; }  @Override int score(ODataRequestContext requestContext); @Override Object unmarshall(ODataRequestContext requestContext); }
JsonActionUnmarshaller extends AbstractUnmarshaller { @Override public int score(ODataRequestContext requestContext) { if (isRightMethodForUnmarshall(requestContext.getRequest()) && ODataUriUtil.isActionCallUri(requestContext.getUri())) { MediaType contentType = requestContext.getRequest().getContentType(); int baseScore = super.score(contentType, MediaType.JSON); int actionScore = baseScore + ACTION_OPERATION_SCORE; LOG.debug("Match for JsonActionUnmarshaller: {} with score: {}", requestContext.getRequest(), actionScore); return actionScore; } return DEFAULT_SCORE; }  @Override int score(ODataRequestContext requestContext); @Override Object unmarshall(ODataRequestContext requestContext);  }