package io.github.kongeor.mocking.anonymous.service;

import static org.junit.Assert.fail;

import org.junit.Test;

public class WormServiceTest {

	@Test
	public void testGetHeroes() {
		fail("Well, you do know what to do ...");
	}

}

@@ -69,163 +69,1280 @@
 org.
-junit.Assert.fail;%0A%0Aimport org.junit.Test;%0A%0Apublic class WormServiceTest %7B%0A%0A%09@Test%0A%09public void testGetHeroes() %7B%0A%09%09fail(%22Well, you do know what to do ...%22
+fest.assertions.api.Assertions.assertThat;%0Aimport static org.powermock.api.mockito.PowerMockito.when;%0Aimport static org.powermock.api.mockito.PowerMockito.whenNew;%0Aimport io.github.kongeor.mocking.anonymous.filter.HeroWormFilter;%0Aimport io.github.kongeor.mocking.anonymous.model.Worm;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.powermock.core.classloader.annotations.PrepareForTest;%0Aimport org.powermock.modules.junit4.PowerMockRunner;%0A%0A@RunWith(PowerMockRunner.class)%0A@PrepareForTest(WormService.class) // this is not right!%0Apublic class WormServiceTest %7B%0A%0A%09private List%3CWorm%3E worms;%0A%09private @Mock Worm worm;%0A%09private @Mock RemoteService remoteService;%0A%09private @Mock HeroWormFilter heroWormFilter;%0A%09%0A%09private WormService wormService;%0A%0A%09@Before%0A%09public void setUp() throws Exception %7B%0A%09%09worms = new ArrayList%3C%3E();%0A%09%09worms.add(worm);%0A%09%09%0A%09%09whenNew(HeroWormFilter.class).withArguments(worm, remoteService)%0A%09%09%09%09.thenReturn(heroWormFilter);%0A%0A%09%09wormService = new WormService(worms, remoteService);%0A%09%7D%0A%09%0A%09@Test%0A%09public void testGetHeroes() %7B%0A%09%09when(heroWormFilter.isHero()).thenReturn(true);%0A%09%09assertThat(wormService.getHeroes()).containsExactly(worm
 );%0A%09

Prepare the WormServiceTest