@Test public void succeedIsCreateOrUpdateRequestWithCorrectMethod() { esRequest = new Request(TestConstants.POST_METHOD, String.format("%s/%s", Constants.CONFIG_PATH_EXPOSED_TO_CUSTOMER, Constants.UPDATE_REQUEST)); boolean result = RequestIdentifier.isMutationRequest(esRequest); assertTrue(result); }
public static boolean isMutationRequest(@NonNull Request esRequest) { String httpMethod = esRequest.getMethod(); return HttpPut.METHOD_NAME.equalsIgnoreCase(httpMethod) || HttpPost.METHOD_NAME.equalsIgnoreCase(httpMethod); }
RequestIdentifier { public static boolean isMutationRequest(@NonNull Request esRequest) { String httpMethod = esRequest.getMethod(); return HttpPut.METHOD_NAME.equalsIgnoreCase(httpMethod) || HttpPost.METHOD_NAME.equalsIgnoreCase(httpMethod); } }
RequestIdentifier { public static boolean isMutationRequest(@NonNull Request esRequest) { String httpMethod = esRequest.getMethod(); return HttpPut.METHOD_NAME.equalsIgnoreCase(httpMethod) || HttpPost.METHOD_NAME.equalsIgnoreCase(httpMethod); }  }
RequestIdentifier { public static boolean isMutationRequest(@NonNull Request esRequest) { String httpMethod = esRequest.getMethod(); return HttpPut.METHOD_NAME.equalsIgnoreCase(httpMethod) || HttpPost.METHOD_NAME.equalsIgnoreCase(httpMethod); }  static boolean isConfigRequest(@NonNull Request esRequest); static boolean isConfigUpdateRequest(@NonNull Request esRequest); static boolean isMutationRequest(@NonNull Request esRequest); static boolean isIndexRequest(@NonNull Request esRequest); static boolean isBulkRequest(@NonNull Request esRequest); static String getIndexName(@NonNull Request esRequest); static Optional<String> getBulkIndexName(@NonNull String payloadLine); }
RequestIdentifier { public static boolean isMutationRequest(@NonNull Request esRequest) { String httpMethod = esRequest.getMethod(); return HttpPut.METHOD_NAME.equalsIgnoreCase(httpMethod) || HttpPost.METHOD_NAME.equalsIgnoreCase(httpMethod); }  static boolean isConfigRequest(@NonNull Request esRequest); static boolean isConfigUpdateRequest(@NonNull Request esRequest); static boolean isMutationRequest(@NonNull Request esRequest); static boolean isIndexRequest(@NonNull Request esRequest); static boolean isBulkRequest(@NonNull Request esRequest); static String getIndexName(@NonNull Request esRequest); static Optional<String> getBulkIndexName(@NonNull String payloadLine);  }