This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.richashworth.testingutils.mocking; | |
public class Footballer { | |
private String name; | |
private int age; | |
private Double salary; | |
private Integer gamesPlayed; | |
private Integer goalsScored; | |
private Boolean isCaptain; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.richashworth.testingutils.mocking; | |
import java.lang.reflect.Method; | |
import java.util.Map; | |
import static org.junit.Assert.fail; | |
public class MockObjectPopulator { | |
private DefaultValues defaultValues = new DefaultValues(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.richashworth.testingutils.mocking; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class DefaultValues { | |
private Map<String, Object> defaultValuesMap; | |
public DefaultValues() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.richashworth.powermockexample; | |
import java.io.File; | |
import java.io.IOException; | |
import java.nio.charset.Charset; | |
import java.util.List; | |
import static com.google.common.io.Files.readLines; | |
public final class DataProvider { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.richashworth.powermockexample; | |
import java.util.List; | |
public class ResultsWriter { | |
public String getDataAsString(){ | |
StringBuilder builder = new StringBuilder(); | |
List<String> dataList = DataProvider.getData(); | |
for(String str: dataList){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.richashworth.powermockexample; | |
import org.junit.Before; | |
import org.junit.BeforeClass; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.powermock.api.mockito.PowerMockito; | |
import org.powermock.core.classloader.annotations.PrepareForTest; | |
import org.powermock.modules.junit4.PowerMockRunner; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.richashworth.testingutils.mocking; | |
import org.junit.Test; | |
import static junit.framework.Assert.assertEquals; | |
public class FootballerTest { | |
@Test | |
public void testGetGameGoalsRatio() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.richashworth.testingutils.mocking; | |
import org.junit.Test; | |
import java.util.HashMap; | |
import java.util.Map; | |
import static junit.framework.Assert.assertEquals; | |
public class FootballerTest2 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( 'text-image' == $format ) | |
$link_item .= '<p> <a href="' . get_bloginfo($rss_type) . '" title="' . esc_attr( $subscribe_to ) . '"><br/>' . esc_html__('RSS - ' . $type_text, 'jetpack'). '</a></p>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ tmux new -s dev |
OlderNewer