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: single responsibility principle solve exercise srp #3

Commits on Feb 25, 2023

  1. ☕ update Tax Calculator with OCP principle

    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] -----------------------------
    marcellodesales committed Feb 25, 2023
    Configuration menu
    Copy the full SHA
    de41c40 View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2023

  1. ☕ ♻️ resolv SRP exercise: refact shapes

    Just moving the methods from the calculator
    marcellodesales committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    2b4b334 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    420e58e View commit details
    Browse the repository at this point in the history
  3. ✅ Update test cases with better interface OCP

    The solution specifies specific results for better results.
    The last test case was broken as well.
    marcellodesales committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    6c093ca View commit details
    Browse the repository at this point in the history