Skip to content

Commit

Permalink
[Azure] Fix flaky storage queue crud test
Browse files Browse the repository at this point in the history
  • Loading branch information
avano authored and jamesnetherton committed Jun 13, 2024
1 parent d03525f commit 866b095
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ public Response deleteQueue() throws Exception {
return Response.noContent().build();
}

@Path("/queue/delete/{id}/{popReceipt}")
// popReceipt may contain a slash, so override its regex to "everything"
@Path("/queue/delete/{id}/{popReceipt:.*}")
@DELETE
public Response deleteMessageById(@PathParam("id") String id, @PathParam("popReceipt") String popReceipt) throws Exception {
var headers = new HashMap<String, Object>();
Expand All @@ -170,7 +171,8 @@ public Response deleteMessageById(@PathParam("id") String id, @PathParam("popRec
return Response.noContent().build();
}

@Path("/queue/update/{id}/{popReceipt}")
// popReceipt may contain a slash, so override its regex to "everything"
@Path("/queue/update/{id}/{popReceipt:.*}")
@POST
@Consumes(MediaType.TEXT_PLAIN)
public Response addMessage(@PathParam("id") String id, @PathParam("popReceipt") String popReceipt, String message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public void crud() {
.then()
.statusCode(201);

// create 2 messages
for (int i = 1; i < 2; i++) {
// create messages
for (int i = 1; i < 3; i++) {
addMessage(message + i);
}

Expand All @@ -61,9 +61,9 @@ public void crud() {
.statusCode(200)
.body(is(message + "1"));

// Read 2 messages
// Read messages
List<LinkedHashMap<String, String>> response = null;
for (int i = 1; i < 2; i++) {
for (int i = 1; i < 3; i++) {
response = readMessage();
assertNotNull(response);
assertEquals(1, response.size());
Expand Down

0 comments on commit 866b095

Please sign in to comment.