Skip to content

Conversation

MK-JavaDeveloper
Copy link
Contributor

I'm not sure if I did everything right.

Did I have to sort @order in order in the test?

@shryhus
Copy link
Contributor

shryhus commented Jan 24, 2021

We added test ordering to provide a natural exercises completion. It should help to do exercises in the most right order.

@shryhus
Copy link
Contributor

shryhus commented Jan 24, 2021

Your ordering seems right, but you can also make corresponding methods sequence in the test class.


@Test
@Order(8)
void getGetUnknownFunction() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we have redundant appendix here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I have already corrected it.


int actualResult = squareFunction.apply(5);

assertEquals(25, actualResult);
Copy link
Contributor

Choose a reason for hiding this comment

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

You should replace all the assertions by "AssertJ" corresponding to Migration Guide .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I corrected it, at least I think so.
I do not fully understand what I am doing and how to do it correctly.
But I hope this time is what it was about it.


import java.util.function.Function;

import static org.junit.jupiter.api.Assertions.assertEquals;
Copy link
Contributor

Choose a reason for hiding this comment

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

If everything is correct these imports are redundant.

@Test
@Order(8)
void getUnknownFunction() {
assertThrows(InvalidFunctionNameException.class, () -> integerFunctionMap.getFunction("sqrt"));
Copy link
Contributor

Choose a reason for hiding this comment

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

AssertJ also supports exceptions. AssertJ Doc

Copy link
Contributor Author

@MK-JavaDeveloper MK-JavaDeveloper Jan 26, 2021

Choose a reason for hiding this comment

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

Sorry, but unfortunately I don't know how to change it. Could you please tell me how to do it. What exactly needs to be written. Unfortunately, I don't understand it yet.

@shryhus shryhus force-pushed the GP-47-Migrate_lambda-math-functions branch from acc24f5 to ccf7b46 Compare January 27, 2021 10:48
@shryhus shryhus merged commit 0e5f3d6 into main Jan 27, 2021
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