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

Fixed a few tests that didn't assert on the outcome #849

Merged
merged 3 commits into from
May 23, 2022
Merged

Conversation

bart-vmware
Copy link
Member

@bart-vmware bart-vmware commented May 16, 2022

While looking at warnings from Resharper, I found some tests that didn't assert on the outcome.

After correcting these tests, some of them failed. I've adapted the target logic accordingly to make the tests succeed without changing their assumptions.

Note this is a breaking change. If taking a breaking change is not an option, we should adapt the tests instead to match the current behavior.

@bart-vmware bart-vmware added the Warn/breaking-change There is a breaking change in the code label May 16, 2022
@bart-vmware bart-vmware requested a review from hananiel May 16, 2022 14:38
@bart-vmware
Copy link
Member Author

/azp run Steeltoe.All

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@hananiel hananiel left a comment

Choose a reason for hiding this comment

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

LGTM. See other comment.

src/Common/src/Common/Util/MimeType.cs Show resolved Hide resolved
@TimHess TimHess added this to the 3.2.0 milestone May 17, 2022
@bart-vmware
Copy link
Member Author

bart-vmware commented May 17, 2022

/azp run Steeltoe.All

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

labels.Contains(KeyValuePair.Create("method", (object)"GET"));

Assert.Contains(KeyValuePair.Create("clientName", (object)"localhost:5555"), labels);
Assert.Contains(KeyValuePair.Create("uri", (object)"/foo/bar"), labels);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the correct assertion. And the code change is correct.

@hananiel
Copy link
Contributor

Note this is a breaking change. If taking a breaking change is not an option, we should adapt the tests instead to match the current behavior.
This fixes the uri to be compatible with the way spring-boot apps report uri. So shouldnt be a problem. Go ahead and merge.

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sonarcloud
Copy link

sonarcloud bot commented May 23, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@TimHess TimHess merged commit e3140c4 into main May 23, 2022
@TimHess TimHess deleted the fix-tests branch May 23, 2022 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Warn/breaking-change There is a breaking change in the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants