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 lambda event json file parser and validation #3421

Merged
merged 10 commits into from
Jan 5, 2023

Conversation

vchikoti1998
Copy link
Contributor

Types of changes

  • [ x] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

Fixed lambda event json file parser and validation

Motivation and Context

Related Issue(s)

#3359

Screenshots (if appropriate)

Screen Shot 2022-12-28 at 5 24 06 PM

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

@vchikoti1998 vchikoti1998 requested a review from a team as a code owner December 29, 2022 01:34
@@ -48,16 +47,10 @@ object PartitionParser {
mapper.readValue(inputStream, Partitions::class.java)
}
}
object EndpointsJsonValidator : RemoteResolveParser {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be deleted? Would this object be required to validate the endpoints file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, adding back

EndpointsJsonValidatorTest::class.java.getResourceAsStream("/jsonSampleFailure.json").use {
assertFalse(EndpointsJsonValidator.canBeParsed(it))
TestCase.assertFalse(EndpointsJsonValidator.canBeParsed(it))
Copy link
Contributor

Choose a reason for hiding this comment

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

Could probably use Assertions.assertThat while asserting all test cases

import software.aws.toolkits.core.lambda.LambdaSampleEventJsonValidator
class LambdaSampleEventJsonValidatorTest {
@Test
fun isJsonParse() {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: rename test to Lambda sample event file can be parsed successfully?

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 5, 2023

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 6 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vchikoti1998 vchikoti1998 merged commit c1251f6 into main Jan 5, 2023
@vchikoti1998 vchikoti1998 deleted the vchikoti/failed-to-parse-partitions branch January 5, 2023 09:20
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.

2 participants