Java 13 Text Block WITHOUT newline

0 votes
159 views
asked Feb 5 by Hitesh Garg (355 points)  

In my test for a repository I have to setup an expected json which will not have any space as I have used Jackson library and the data to persist in database should not even have any space in it.
But at the same time it becomes difficult to setup the big expected json in test as it is in the same line.
Is there a way in Java 13 to skip the newline while writing the json.

Expected input

"""
{
"name":"codingeek",
"type":"blog"
}
"""

Expected output

{"name":"codingeek","type":"blog"}

Please log in or register to answer this question.

...