Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with Assert.assertEquals assertion in testing

 
preethi kumar
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



I am getting a Assertion error even though the 2 strings are same? any idea how can i do proper Assertion?
 
preethi kumar
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any idea?
 
Junilu Lacar
Bartender
Pie
Posts: 7316
45
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
preethi kumar wrote:
I am getting a Assertion error even though the 2 strings are same? any idea how can i do proper Assertion?

Are you sure they are the same? JUnit doesn't lie. What assertion error messages are you getting? Maybe the actual values have spaces or something that make it only look like they're the same as your expected values.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic