@Override
    public void process(Exchange exchange) throws Exception {
        String operation = getOperation(exchange);

        switch (operation) {
            case GlanceConstants.RESERVE:
                doReserve(exchange);
                break;
            case OpenstackConstants.CREATE:
                doCreate(exchange);
                break;
            case OpenstackConstants.UPDATE:
                doUpdate(exchange);
                break;
            case GlanceConstants.UPLOAD:
                doUpload(exchange);
                break;
            case OpenstackConstants.GET:
                doGet(exchange);
                break;
            case OpenstackConstants.GET_ALL:
                doGetAll(exchange);
                break;
            case OpenstackConstants.DELETE:
                doDelete(exchange);
                break;
            default:
                throw new IllegalArgumentException("Unsupported operation " + operation);
        }
    }
@Test
    public void reserveTest() throws Exception {
        when(endpoint.getOperation()).thenReturn(GlanceConstants.RESERVE);
        msg.setBody(dummyImage);
        producer.process(exchange);

        verify(imageService).reserve(captor.capture());
        assertEquals(dummyImage, captor.getValue());

        Image result = msg.getBody(Image.class);
        assertNotNull(result.getId());
        assertEqualsImages(dummyImage, result);
    }