BrokerResponse createQueueResponse(String queueName) throws IOException {
    String queryUrl = createQueueEndpoint(messageVpn);
    ImmutableMap<String, Object> params =
        ImmutableMap.<String, Object>builder()
            .put("accessType", "non-exclusive")
            .put("queueName", queueName)
            .put("owner", username)
            .put("permission", "consume")
            .put("ingressEnabled", true)
            .put("egressEnabled", true)
            .build();

    HttpResponse response = executePost(new GenericUrl(baseUrl + queryUrl), params);
    return BrokerResponse.fromHttpResponse(response);
  }
@Test
  public void testCreateQueueResponseEncoding() throws IOException {
    MockHttpTransport transport =
        new MockHttpTransport() {
          @Override
          public LowLevelHttpRequest buildRequest(String method, String url) {
            return new MockLowLevelHttpRequest() {
              @Override
              public LowLevelHttpResponse execute() throws IOException {
                MockLowLevelHttpResponse response = new MockLowLevelHttpResponse();
                assertTrue(this.getContentAsString().contains("\"queueName\":\"queue/xxx/yyy\""));
                assertTrue(url.contains("msgVpns/vpnName%232"));
                return response;
              }
            };
          }
        };

    HttpRequestFactory requestFactory = transport.createRequestFactory();
    SempBasicAuthClientExecutor client =
        new SempBasicAuthClientExecutor(
            "http://host", "username", "password", "vpnName#2", requestFactory);

    client.createQueueResponse("queue/xxx/yyy");
  }