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

Feature/fdp 1815 #12

Merged
merged 12 commits into from
Feb 1, 2024
Merged

Feature/fdp 1815 #12

merged 12 commits into from
Feb 1, 2024

Conversation

LucianoFavoroso
Copy link
Contributor

No description provided.

Signed-off-by: Luciano Favoroso <[email protected]>
Signed-off-by: Luciano Favoroso <[email protected]>
Signed-off-by: Luciano Favoroso <[email protected]>
Signed-off-by: Luciano Favoroso <[email protected]>
Signed-off-by: Luciano Favoroso <[email protected]>
Signed-off-by: Luciano Favoroso <[email protected]>
Signed-off-by: Luciano Favoroso <[email protected]>
Signed-off-by: Luciano Favoroso <[email protected]>
sanderv
sanderv previously approved these changes Jan 29, 2024
Signed-off-by: Luciano Favoroso <[email protected]>
Signed-off-by: Luciano Favoroso <[email protected]>
sanderv
sanderv previously approved these changes Jan 30, 2024
Comment on lines +19 to +21
fun extractKeyFromCommand(command: String) = pskKeyHashSplitterRegex.findAll(command).first().groups[1]!!.value

fun extractHashFromCommand(command: String) = pskKeyHashSplitterRegex.findAll(command).first().groups[2]!!.value
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rather have one regex findAll instead of 2 but for the simulator this could be good enough

@InjectMocks
private lateinit var pskCommandHandler: PskCommandHandler

private val key = "1234567891234567"
Copy link
Member

Choose a reason for hiding this comment

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

I would expect to see an old and a new key in this test.

@BeforeEach
fun setup() {
`when`(simulatorProperties.pskIdentity).thenReturn(identity)
`when`(pskRepository.findById(any())).thenReturn(Optional.of(PreSharedKey(identity, key, secret)))
Copy link
Member

Choose a reason for hiding this comment

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

Here return a PSK with an old key


assertThatExceptionOfType(InvalidPskHashException::class.java).isThrownBy {
pskCommandHandler.handlePskChange(pskCommand)
}
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer to have separate sections for act and assert.
Consider adding some verification that both repository and store are not changed as well.

pskCommandHandler.handlePskChange(pskCommand)
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Add newline at end of file

Signed-off-by: Luciano Favoroso <[email protected]>
Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
84.2% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@LucianoFavoroso LucianoFavoroso merged commit a844709 into main Feb 1, 2024
3 checks passed
@smvdheijden smvdheijden deleted the feature/FDP-1815 branch February 2, 2024 08:21
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