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

CUSTCOM-75 Fix Payara System Property REST API #4497

Merged
merged 5 commits into from
Feb 21, 2020
Merged

CUSTCOM-75 Fix Payara System Property REST API #4497

merged 5 commits into from
Feb 21, 2020

Conversation

MattGill98
Copy link
Contributor

Description

This is a bug fix.

This change allows instance property overrides to be created without deleting all the other instance properties by using the REST endpoint correctly. It also allows empty property fields to be submitted to remove the property.

Firstly the PUT and POST methods were the wrong way around, so they've been swapped. Secondly, the POST method didn't allow empty fields, which meant that instance property overrides couldn't be removed. To stop this, empty properties are now treated as properties to be removed.

Testing

Testing Performed

Setting up domain with:

asadmin copy-config default-config test-config
asadmin create-instance --node localhost-domain1 --config test-config instance1
asadmin create-system-properties --target instance1 ASADMIN_LISTENER_PORT=12345
asadmin create-system-properties --target instance1 HTTP_LISTENER_PORT=23456

From the admin console tried:

  • removing an instance property from test-config -> system-properties -> instance values
  • creating an instance property from test-config -> system-properties -> instance values
  • removing an instance property from instances -> instance1 -> properties
  • creating an instance property from instances -> instance1 -> properties

Test suites executed

N/A

This change allows instance property overrides to be created without
deleting all the other instance properties by using the REST endpoint
correctly. It also allows empty property fields to be submitted to
remove the property.

Firstly the PUT and POST methods were the wrong way around, so they've
been swapped. Secondly, the POST method didn't allow empty fields, which
meant that instance property overrides couldn't be removed. To stop
this, empty properties are now treated as properties to be removed.

Signed-off-by: Matt Gill <matthew.gill@live.co.uk>
Added some javadocs for the class methods, and made a minor refactor to
one method signature.

Signed-off-by: Matt Gill <matthew.gill@live.co.uk>
@MattGill98 MattGill98 self-assigned this Feb 17, 2020
The page title didn't have the parameter filled.

Signed-off-by: Matt Gill <matthew.gill@live.co.uk>
Copy link
Contributor

@MarkWareham MarkWareham left a comment

Choose a reason for hiding this comment

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

LGTM

The @NotMicroCompatible and @SincePayara annotations should be inherited
when abstract test classes are annotated with them.

Signed-off-by: Matt Gill <matthew.gill@live.co.uk>
This commit adds a set of tests for the system-properties endpoint of
the REST management interface, to make sure that it responds correctly
to PUT and POST requests.

An arquillian extension has been added to allow temporary instances to
be created for the purposes of tests.

Signed-off-by: Matt Gill <matthew.gill@live.co.uk>
@MattGill98
Copy link
Contributor Author

jenkins test please

@MattGill98 MattGill98 merged commit a35a12b into payara:master Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants