@Test public void testWriteWithPutReturnMinimal() throws Exception { requestContext = createContextWithEntity(PUT, true); when(dataSourceFactory.getDataSource(requestContext, entityType)).thenReturn(dataSource); when(dataSource.update(requestContext.getUri(), entity, entityDataModel)).thenReturn(entity); ProcessorResult result = oDataWriteProcessor.write(requestContext, entity); assertThat(result.getStatus(), is(NO_CONTENT)); assertThat(result.getData(), is(nullValue())); Map<String, String> headers = result.getHeaders(); assertThat(headers.size(), is(1)); assertThat(headers.get("Location"), is("http: }
@Override public ProcessorResult write(ODataRequestContext requestContext, Object entity) throws ODataException { try { WriteMethodHandler methodHandler = getHandler(requestContext); if (methodHandler == null) { return new ProcessorResult(METHOD_NOT_ALLOWED); } return methodHandler.handleWrite(entity); } catch (Exception e) { LOG.error("Couldn't persist or delete given entity '" + entity + "'", e); throw e; } }
ODataWriteProcessorImpl implements ODataWriteProcessor { @Override public ProcessorResult write(ODataRequestContext requestContext, Object entity) throws ODataException { try { WriteMethodHandler methodHandler = getHandler(requestContext); if (methodHandler == null) { return new ProcessorResult(METHOD_NOT_ALLOWED); } return methodHandler.handleWrite(entity); } catch (Exception e) { LOG.error("Couldn't persist or delete given entity '" + entity + "'", e); throw e; } } }
ODataWriteProcessorImpl implements ODataWriteProcessor { @Override public ProcessorResult write(ODataRequestContext requestContext, Object entity) throws ODataException { try { WriteMethodHandler methodHandler = getHandler(requestContext); if (methodHandler == null) { return new ProcessorResult(METHOD_NOT_ALLOWED); } return methodHandler.handleWrite(entity); } catch (Exception e) { LOG.error("Couldn't persist or delete given entity '" + entity + "'", e); throw e; } }  }
ODataWriteProcessorImpl implements ODataWriteProcessor { @Override public ProcessorResult write(ODataRequestContext requestContext, Object entity) throws ODataException { try { WriteMethodHandler methodHandler = getHandler(requestContext); if (methodHandler == null) { return new ProcessorResult(METHOD_NOT_ALLOWED); } return methodHandler.handleWrite(entity); } catch (Exception e) { LOG.error("Couldn't persist or delete given entity '" + entity + "'", e); throw e; } }  @Override ProcessorResult write(ODataRequestContext requestContext, Object entity); }
ODataWriteProcessorImpl implements ODataWriteProcessor { @Override public ProcessorResult write(ODataRequestContext requestContext, Object entity) throws ODataException { try { WriteMethodHandler methodHandler = getHandler(requestContext); if (methodHandler == null) { return new ProcessorResult(METHOD_NOT_ALLOWED); } return methodHandler.handleWrite(entity); } catch (Exception e) { LOG.error("Couldn't persist or delete given entity '" + entity + "'", e); throw e; } }  @Override ProcessorResult write(ODataRequestContext requestContext, Object entity);  }