I need to mock a static method with moockito but I could not this is my code
this is the class i want to mock
String buc = TrackerGenerator.getMetadataLocalThread().getIdUsuarioFinal();
and this is the test
@Test
public void serviceTest() {
TrackerGenerator trackerGenerator = mock(TrackerGenerator.class);
when(TrackerGenerator.getMetadataLocalThread().getIdUsuarioFinal()).thenReturn("0");
TrackerGenerator.setMetadataLocalThread(new ThreadLocal<>());
}