File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with Assert.assertEquals assertion in testing

 
preethi kumar
Ranch Hand
Posts: 50
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any idea?
 
Junilu Lacar
Bartender
Pie
Posts: 6529
21
Java Linux Mac Scala Spring
  • 0
  • 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