@Test public void testProcessEntryPut() { EasyMock.replay(responseMock); EasyMock.expect(requestMock.getMethod()).andReturn("PUT"); EasyMock.replay(requestMock); EasyMock.expect(adapterMock.putEntry(requestMock)).andReturn(responseMock); EasyMock.replay(adapterMock); ResponseContext response = processor.processEntry(requestMock, adapterMock); assertNotNull(response); }
protected ResponseContext processEntry(RequestContext context, CollectionAdapter adapter) { String method = context.getMethod(); if (method.equalsIgnoreCase("GET")) { return adapter.getEntry(context); } else if (method.equalsIgnoreCase("POST")) { return adapter.postEntry(context); } else if (method.equalsIgnoreCase("PUT")) { return adapter.putEntry(context); } else if (method.equalsIgnoreCase("DELETE")) { return adapter.deleteEntry(context); } else if (method.equalsIgnoreCase("HEAD")) { return adapter.headEntry(context); } else if (method.equalsIgnoreCase("OPTIONS")) { return adapter.optionsEntry(context); } else { return null; } }
EntryRequestProcessor implements RequestProcessor { protected ResponseContext processEntry(RequestContext context, CollectionAdapter adapter) { String method = context.getMethod(); if (method.equalsIgnoreCase("GET")) { return adapter.getEntry(context); } else if (method.equalsIgnoreCase("POST")) { return adapter.postEntry(context); } else if (method.equalsIgnoreCase("PUT")) { return adapter.putEntry(context); } else if (method.equalsIgnoreCase("DELETE")) { return adapter.deleteEntry(context); } else if (method.equalsIgnoreCase("HEAD")) { return adapter.headEntry(context); } else if (method.equalsIgnoreCase("OPTIONS")) { return adapter.optionsEntry(context); } else { return null; } } }
EntryRequestProcessor implements RequestProcessor { protected ResponseContext processEntry(RequestContext context, CollectionAdapter adapter) { String method = context.getMethod(); if (method.equalsIgnoreCase("GET")) { return adapter.getEntry(context); } else if (method.equalsIgnoreCase("POST")) { return adapter.postEntry(context); } else if (method.equalsIgnoreCase("PUT")) { return adapter.putEntry(context); } else if (method.equalsIgnoreCase("DELETE")) { return adapter.deleteEntry(context); } else if (method.equalsIgnoreCase("HEAD")) { return adapter.headEntry(context); } else if (method.equalsIgnoreCase("OPTIONS")) { return adapter.optionsEntry(context); } else { return null; } }  }
EntryRequestProcessor implements RequestProcessor { protected ResponseContext processEntry(RequestContext context, CollectionAdapter adapter) { String method = context.getMethod(); if (method.equalsIgnoreCase("GET")) { return adapter.getEntry(context); } else if (method.equalsIgnoreCase("POST")) { return adapter.postEntry(context); } else if (method.equalsIgnoreCase("PUT")) { return adapter.putEntry(context); } else if (method.equalsIgnoreCase("DELETE")) { return adapter.deleteEntry(context); } else if (method.equalsIgnoreCase("HEAD")) { return adapter.headEntry(context); } else if (method.equalsIgnoreCase("OPTIONS")) { return adapter.optionsEntry(context); } else { return null; } }  ResponseContext process(RequestContext context,
                                   WorkspaceManager workspaceManager,
                                   CollectionAdapter collectionAdapter); }
EntryRequestProcessor implements RequestProcessor { protected ResponseContext processEntry(RequestContext context, CollectionAdapter adapter) { String method = context.getMethod(); if (method.equalsIgnoreCase("GET")) { return adapter.getEntry(context); } else if (method.equalsIgnoreCase("POST")) { return adapter.postEntry(context); } else if (method.equalsIgnoreCase("PUT")) { return adapter.putEntry(context); } else if (method.equalsIgnoreCase("DELETE")) { return adapter.deleteEntry(context); } else if (method.equalsIgnoreCase("HEAD")) { return adapter.headEntry(context); } else if (method.equalsIgnoreCase("OPTIONS")) { return adapter.optionsEntry(context); } else { return null; } }  ResponseContext process(RequestContext context,
                                   WorkspaceManager workspaceManager,
                                   CollectionAdapter collectionAdapter);  }