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

Add new tests to CTS #7328

Merged
merged 2 commits into from
Jan 29, 2023
Merged

Add new tests to CTS #7328

merged 2 commits into from
Jan 29, 2023

Conversation

mandy-chessell
Copy link
Contributor

Signed-off-by: Mandy Chessell mandy.e.chessell@gmail.com

Description

This PR makes changes to the CTS to test the new getEntityDetailHistory and getRelationshipHistory methods. It also fixes the graph failure caused by its failure to set up the header correctly in entities.

Related Issue(s)

#7254
#7148

Testing

Running the CTS with in memory and graph

Release Notes & Documentation

No

Additional notes

This is the first of a number of PRs to expand the detail covered by the CTS

Signed-off-by: Mandy Chessell <mandy.e.chessell@gmail.com>
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

@mandy-chessell mandy-chessell merged commit d2c29f5 into odpi:main Jan 29, 2023
@@ -521,11 +521,11 @@ private void checkEndpointOK(ConnectionManager client,
{
throw new FVTUnexpectedCondition(testCaseName, activityName + "(Bad qualifiedName from Retrieve) =>>" + retrievedEndpoint);
}
if (! endpointTechnicalName.equals(retrievedEndpoint.getTechnicalName()))
if (! endpointTechnicalName.equals(retrievedEndpoint.getResourceName()))
Copy link
Contributor

Choose a reason for hiding this comment

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

5% of developers fix this issue

💬 7 similar findings have been found in this PR


YodaCondition: The non-constant portion of an equals check generally comes first.


Suggested change
if (! endpointTechnicalName.equals(retrievedEndpoint.getResourceName()))
if (! Objects.equals(retrievedEndpoint.getResourceName(), endpointTechnicalName))

🔎 Expand here to view all instances of this finding
File Path Line Number
open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/connections/CreateConnectionTest.java 528
open-metadata-test/open-metadata-fvt/access-services-fvt/asset-owner-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetowner/fvt/connections/CreateConnectionTest.java 479
open-metadata-test/open-metadata-fvt/access-services-fvt/asset-owner-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetowner/fvt/connections/CreateConnectionTest.java 450
open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/connections/CreateConnectionTest.java 562
open-metadata-test/open-metadata-fvt/access-services-fvt/digital-architecture-fvt/src/main/java/org/odpi/openmetadata/accessservices/digitalarchitecture/fvt/connections/CreateConnectionTest.java 558
open-metadata-test/open-metadata-fvt/access-services-fvt/asset-owner-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetowner/fvt/connections/CreateConnectionTest.java 483
open-metadata-test/open-metadata-fvt/access-services-fvt/asset-owner-fvt/src/main/java/org/odpi/openmetadata/accessservices/assetowner/fvt/connections/CreateConnectionTest.java 446

Visit the Lift Web Console to find more details in your report.


ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

if (!expectedGUIDs.contains(matchGUID)) {
if (knownStringValue.startsWith(truncatedStringValue))
{
for (String matchGUID : propValues.get(knownStringValue))
Copy link
Contributor

Choose a reason for hiding this comment

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

10% of developers fix this issue

💬 7 similar findings have been found in this PR


INEFFICIENT_KEYSET_ITERATOR: Accessing a value using a key that was retrieved from a keySet iterator. It is more efficient to use an iterator on the entrySet of the map, avoiding the extra HashMap.get(key) lookup.


🔎 Expand here to view all instances of this finding
File Path Line Number
open-metadata-conformance-suite/open-metadata-conformance-suite-server/src/main/java/org/odpi/openmetadata/conformance/tests/repository/instances/TestSupportedEntitySearch.java 2453
open-metadata-conformance-suite/open-metadata-conformance-suite-server/src/main/java/org/odpi/openmetadata/conformance/tests/repository/instances/TestSupportedEntitySearch.java 2466
open-metadata-conformance-suite/open-metadata-conformance-suite-server/src/main/java/org/odpi/openmetadata/conformance/tests/repository/instances/TestSupportedEntitySearch.java 1563
open-metadata-conformance-suite/open-metadata-conformance-suite-server/src/main/java/org/odpi/openmetadata/conformance/tests/repository/instances/TestSupportedEntitySearch.java 2479
open-metadata-conformance-suite/open-metadata-conformance-suite-server/src/main/java/org/odpi/openmetadata/conformance/tests/repository/instances/TestSupportedEntitySearch.java 1602
open-metadata-conformance-suite/open-metadata-conformance-suite-server/src/main/java/org/odpi/openmetadata/conformance/tests/repository/instances/TestSupportedEntitySearch.java 1589
open-metadata-conformance-suite/open-metadata-conformance-suite-server/src/main/java/org/odpi/openmetadata/conformance/tests/repository/instances/TestSupportedEntitySearch.java 2440

Visit the Lift Web Console to find more details in your report.


ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@@ -200,15 +220,17 @@
String end1DefName = relationshipDef.getEndDef1().getEntityType().getName();
Copy link
Contributor

Choose a reason for hiding this comment

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

15% of developers fix this issue

💬 5 similar findings have been found in this PR


NULL_DEREFERENCE: object returned by TestSupportedRelationshipLifecycle.relationshipDef.getEndDef1().getEntityType() could be null and is dereferenced at line 220.


🔎 Expand here to view all instances of this finding
File Path Line Number
open-metadata-conformance-suite/open-metadata-conformance-suite-server/src/main/java/org/odpi/openmetadata/conformance/tests/repository/instances/TestSupportedRelationshipLifecycle.java 220
open-metadata-conformance-suite/open-metadata-conformance-suite-server/src/main/java/org/odpi/openmetadata/conformance/tests/repository/instances/TestSupportedRelationshipLifecycle.java 229
open-metadata-conformance-suite/open-metadata-conformance-suite-server/src/main/java/org/odpi/openmetadata/conformance/tests/repository/instances/TestGraphQueries.java 399
open-metadata-implementation/adapters/open-connectors/repository-services-connectors/open-metadata-collection-store-connectors/graph-repository-connector/src/main/java/org/odpi/openmetadata/adapters/repositoryservices/graphrepository/repositoryconnector/GraphOMRSMetadataStore.java 418
open-metadata-conformance-suite/open-metadata-conformance-suite-server/src/main/java/org/odpi/openmetadata/conformance/tests/repository/instances/TestSupportedRelationshipLifecycle.java 229

Visit the Lift Web Console to find more details in your report.


ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@sonatype-lift
Copy link
Contributor

sonatype-lift bot commented Jan 29, 2023

🛠 Lift Auto-fix

Some of the Lift findings in this PR can be automatically fixed. You can download and apply these changes in your local project directory of your branch to review the suggestions before committing.1

# Download the patch
curl https://lift.sonatype.com/api/patch/github.com/odpi/egeria/7328.diff -o lift-autofixes.diff

# Apply the patch with git
git apply lift-autofixes.diff

# Review the changes
git diff

Want it all in a single command? Open a terminal in your project's directory and copy and paste the following command:

curl https://lift.sonatype.com/api/patch/github.com/odpi/egeria/7328.diff | git apply

Once you're satisfied commit and push your changes in your project.

Footnotes

  1. You can preview the patch by opening the patch URL in the browser.

@planetf1 planetf1 mentioned this pull request Jan 31, 2023
33 tasks
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.

1 participant