Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-14470

REST cache configuration comparison returns 204 for different caches

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 14.0.7.Final, 15.0.0.Final
    • 14.0.6.Final, 15.0.0.Final
    • REST
    • None
    • Hide

      Subject: [PATCH] Reproducer

      Index: server/rest/src/test/java/org/infinispan/rest/resources/CacheResourceV2Test.java
      IDEA additional info:
      Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
      <+>UTF-8
      ===================================================================
      diff --git a/server/rest/src/test/java/org/infinispan/rest/resources/CacheResourceV2Test.java b/server/rest/src/test/java/org/infinispan/rest/resources/CacheResourceV2Test.java
      — a/server/rest/src/test/java/org/infinispan/rest/resources/CacheResourceV2Test.java (revision bd01a54d0ebb80ba7a305bbad573ba1869eb6fd4)
      +++ b/server/rest/src/test/java/org/infinispan/rest/resources/CacheResourceV2Test.java (date 1674126559167)
      @@ -1392,6 +1392,12 @@
      response = rawClient.postMultipartForm("/rest/v2/caches?action=compare&ignoreMutable=true", Collections.emptyMap(), form);
      assertThat(response).isConflicted();

      + form = new HashMap<>();
      + form.put("one", Collections.singletonList("{\"local-cache\":{\"statistics\":true,\"encoding\":{\"key\":

      {\"media-type\":\"text/plain\"}

      ,\"value\":{\"media-type\":\"text/plain\"}},\"memory\":

      {\"max-count\":\"50\"}

      }}"));
      + form.put("two", Collections.singletonList("{\"local-cache\":{\"statistics\":true,\"encoding\":{\"key\":

      {\"media-type\":\"application/x-protostream\"}

      ,\"value\":{\"media-type\":\"application/x-protostream\"}},\"memory\":

      {\"max-count\":\"50\"}

      }}"));
      +
      + response = rawClient.postMultipartForm("/rest/v2/caches?action=compare", Collections.emptyMap(), form);
      + assertThat(response).isConflicted();
      }

      private void assertBadResponse(RestCacheClient client, String config) {

      Show
      Subject: [PATCH] Reproducer — Index: server/rest/src/test/java/org/infinispan/rest/resources/CacheResourceV2Test.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/server/rest/src/test/java/org/infinispan/rest/resources/CacheResourceV2Test.java b/server/rest/src/test/java/org/infinispan/rest/resources/CacheResourceV2Test.java — a/server/rest/src/test/java/org/infinispan/rest/resources/CacheResourceV2Test.java (revision bd01a54d0ebb80ba7a305bbad573ba1869eb6fd4) +++ b/server/rest/src/test/java/org/infinispan/rest/resources/CacheResourceV2Test.java (date 1674126559167) @@ -1392,6 +1392,12 @@ response = rawClient.postMultipartForm("/rest/v2/caches?action=compare&ignoreMutable=true", Collections.emptyMap(), form); assertThat(response).isConflicted(); + form = new HashMap<>(); + form.put("one", Collections.singletonList("{\"local-cache\":{\"statistics\":true,\"encoding\":{\"key\": {\"media-type\":\"text/plain\"} ,\"value\":{\"media-type\":\"text/plain\"}},\"memory\": {\"max-count\":\"50\"} }}")); + form.put("two", Collections.singletonList("{\"local-cache\":{\"statistics\":true,\"encoding\":{\"key\": {\"media-type\":\"application/x-protostream\"} ,\"value\":{\"media-type\":\"application/x-protostream\"}},\"memory\": {\"max-count\":\"50\"} }}")); + + response = rawClient.postMultipartForm("/rest/v2/caches?action=compare", Collections.emptyMap(), form); + assertThat(response).isConflicted(); } private void assertBadResponse(RestCacheClient client, String config) {

      Comparison of certain cache configurations falsely return 204 even though the configurations are different.

      So far I have seen this with the encoding media type, but it could also be a problem for other configuration attributes.

              ttarrant@redhat.com Tristan Tarrant
              remerson@redhat.com Ryan Emerson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: