Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix WebViewsIT #5388

Merged
merged 1 commit into from
Mar 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected void configureClient(ClientConfig config) {
config.register(WebViewsIT.HashMapWriter.class);
}

private static AtomicReference<Monitor> monitor = new AtomicReference<>(null);
private static final AtomicReference<Monitor> monitor = new AtomicReference<>(null);

@BeforeAll
public static void createMocks() throws TableNotFoundException {
Expand Down Expand Up @@ -123,18 +123,17 @@ public void testGetTablesConstraintViolations() {
* a registered MessageBodyWriter capable of serializing/writing the object returned from your
* endpoint. We're using a simple stubbed out inner class HashMapWriter for this.
*
* @throws Exception not expected
*/
@Test
public void testGetTablesConstraintPassing() throws Exception {
public void testGetTablesConstraintPassing() {
// Using the mocks we can verify that the getModel method gets called via debugger
// however it's difficult to continue to mock through the jersey MVC code for the properly built
// response.
// Our silly HashMapWriter registered in the configure method gets wired in and used here.
Response output = target("tables/foo").request().get();
assertEquals(200, output.getStatus(), "should return status 200");
String responseBody = output.readEntity(String.class);
assertTrue(responseBody.contains("tableID=foo") && responseBody.contains("table=bar"));
assertTrue(responseBody.contains("tableId=foo") && responseBody.contains("table=bar"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could a constant be used for tableId?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I was thinking about this too. It seems like a good improvement. It would probably be helpful and make the code safer but would be a lot more changes. I'll merge this PR to get the test passing in the build and then create a follow on to add constants for all of the parameters in this category.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #5394 to track this.

}

/**
Expand Down