forked from dangeabunea/pluralsight-refactoring-solid-java17
-
Notifications
You must be signed in to change notification settings - Fork 0
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: single responsibility principle solve exercise srp #3
Merged
marcellodesales
merged 4 commits into
master
from
feature/single-responsibility-principle-solve-exercise-srp
Feb 27, 2023
Merged
Feature: single responsibility principle solve exercise srp #3
marcellodesales
merged 4 commits into
master
from
feature/single-responsibility-principle-solve-exercise-srp
Feb 27, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The tests now pass as they were broken before $ mvn test [INFO] Scanning for projects... [INFO] [INFO] --------------------< org.example:ocp-checkpoint-1 >-------------------- [INFO] Building ocp-checkpoint-1 1.0-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- resources:3.3.0:resources (default-resources) @ ocp-checkpoint-1 --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /Users/marcellodesales/dev/github.com/marcellodesales/pluralsight-refactoring-solid-java17/2-ocp/checkpoints/checkpoint1/before/src/main/resources [INFO] [INFO] --- compiler:3.7.0:compile (default-compile) @ ocp-checkpoint-1 --- [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] Compiling 2 source files to /Users/marcellodesales/dev/github.com/marcellodesales/pluralsight-refactoring-solid-java17/2-ocp/checkpoints/checkpoint1/before/target/classes [INFO] [INFO] --- resources:3.3.0:testResources (default-testResources) @ ocp-checkpoint-1 --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /Users/marcellodesales/dev/github.com/marcellodesales/pluralsight-refactoring-solid-java17/2-ocp/checkpoints/checkpoint1/before/src/test/resources [INFO] [INFO] --- compiler:3.7.0:testCompile (default-testCompile) @ ocp-checkpoint-1 --- [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] Compiling 2 source files to /Users/marcellodesales/dev/github.com/marcellodesales/pluralsight-refactoring-solid-java17/2-ocp/checkpoints/checkpoint1/before/target/test-classes [INFO] [INFO] --- surefire:2.22.2:test (default-test) @ ocp-checkpoint-1 --- [INFO] [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running TaxCalculatorTests [ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.028 s <<< FAILURE! - in TaxCalculatorTests [ERROR] shouldCalculateTaxesWithNationality Time elapsed: 0.019 s <<< ERROR! java.util.NoSuchElementException: No value present at TaxCalculatorTests.shouldCalculateTaxesWithNationality(TaxCalculatorTests.java:35) [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] TaxCalculatorTests.shouldCalculateTaxesWithNationality:35 Β» NoSuchElement No v... [INFO] [ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.550 s [INFO] Finished at: 2023-02-25T12:54:13-08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project ocp-checkpoint-1: There are test failures. [ERROR] [ERROR] Please refer to /Users/marcellodesales/dev/github.com/marcellodesales/pluralsight-refactoring-solid-java17/2-ocp/checkpoints/checkpoint1/before/target/surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException βοΈ aws-cli@2.2.32 π aws-iam-authenticator@0.5.3 βΈοΈ kubectl@1.25.4 KustomizeVersion: v4.5.7 π kustomize@v4.4.0 π‘ helm@3.7.0 π½ argocd@2.3.3 π€Ή argocd@3.2.8βοΈ glooctl@1.9.0 π€ AWS_PS1_PROFILE ποΈ π sa-east-1 π π arn:aws:eks:sa-east-1:806101772216:cluster/eks-ppd-prdt-super-cash π± default ~/dev/github.com/marcellodesales/pluralsight-refactoring-solid-java17/2-ocp/checkpoints/checkpoint1/before on ξ feature/single-responsibility-principle-solve-exercise-srp! π 02-25-2023 β12:54:13 $ mvn test [INFO] Scanning for projects... [INFO] [INFO] --------------------< org.example:ocp-checkpoint-1 >-------------------- [INFO] Building ocp-checkpoint-1 1.0-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- resources:3.3.0:resources (default-resources) @ ocp-checkpoint-1 --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /Users/marcellodesales/dev/github.com/marcellodesales/pluralsight-refactoring-solid-java17/2-ocp/checkpoints/checkpoint1/before/src/main/resources [INFO] [INFO] --- compiler:3.7.0:compile (default-compile) @ ocp-checkpoint-1 --- [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [INFO] Compiling 2 source files to /Users/marcellodesales/dev/github.com/marcellodesales/pluralsight-refactoring-solid-java17/2-ocp/checkpoints/checkpoint1/before/target/classes [INFO] [INFO] --- resources:3.3.0:testResources (default-testResources) @ ocp-checkpoint-1 --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /Users/marcellodesales/dev/github.com/marcellodesales/pluralsight-refactoring-solid-java17/2-ocp/checkpoints/checkpoint1/before/src/test/resources [INFO] [INFO] --- compiler:3.7.0:testCompile (default-testCompile) @ ocp-checkpoint-1 --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- surefire:2.22.2:test (default-test) @ ocp-checkpoint-1 --- [INFO] [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running TaxCalculatorTests [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.023 s - in TaxCalculatorTests [INFO] [INFO] Results: [INFO] [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.908 s [INFO] Finished at: 2023-02-25T12:54:48-08:00 [INFO] -----------------------------
Just moving the methods from the calculator
The solution specifies specific results for better results. The last test case was broken as well.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π Resolve OCP with better tests
Map.of()
instead of a list, as we can map the expected resultsBefore
π After Solution