chore: Add unit test for view-generator service#196
Conversation
Codecov Report
@@ Coverage Diff @@
## main #196 +/- ##
============================================
+ Coverage 78.92% 79.51% +0.59%
- Complexity 1128 1133 +5
============================================
Files 101 101
Lines 4370 4370
Branches 406 406
============================================
+ Hits 3449 3475 +26
+ Misses 732 704 -28
- Partials 189 191 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
| assertEquals(50,rawTraceViews.get(0).getNumSpans()); | ||
| // assertEquals(ByteBuffer.wrap("java.nio.HeapByteBuffer[pos=0 lim=44 cap=44]".getBytes("UTF-8")),rawTraceViews.get(0).getTraceId()); | ||
| // | ||
| // ByteBuffer bf = rawTraceViews.get(0).getTraceId(); |
There was a problem hiding this comment.
nit: remove this commented code.
|
Build is failing, try |
|
nit: rename the pr to |
This comment has been minimized.
This comment has been minimized.
| } | ||
|
|
||
| @Test | ||
| public void testGenerateView_HotrodTrace() throws IOException { |
There was a problem hiding this comment.
I think it is a good practice to name the test aftert the scenario it is testing. What are we trying to verify here?
There was a problem hiding this comment.
So, this is a unit test with a sample trace to test the corresponding view
maybe we could rename it to testGenerateView_SampleHotrodTrace ?
|
|
||
| @Test | ||
| public void testGenerateView_HotrodTrace() throws IOException { | ||
| URL resource = |
There was a problem hiding this comment.
I think from here to line 33 is the preparation for the test and we could abstract it into a private static function, otherwise it makes it makes noise when reading the test.
Added unit tests for RawTraceViewGenerator.java class