This file contains 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
[user] | |
name = abc | |
email = [email protected] | |
[core] | |
excludesfile = ~/.gitignore_global | |
[color] | |
ui = auto |
This file contains 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.awilmore.testutils; | |
import java.lang.reflect.Constructor; | |
import java.lang.reflect.InvocationTargetException; | |
import junit.framework.Assert; | |
public class ExceptionTester extends Assert { | |
public ExceptionTester(Class<?> exceptionClass) { |
This file contains 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.awilmore.stringutils; | |
import static javax.xml.bind.DatatypeConverter.parseBase64Binary; | |
import static javax.xml.bind.DatatypeConverter.printBase64Binary; | |
public class Base64Util { | |
public static String decode(String encoded) { | |
byte[] decoded = parseBase64Binary(encoded); | |
return new String(decoded); |
This file contains 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.awilmore.ioutils; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.nio.ByteBuffer; | |
import java.nio.channels.Channels; | |
import java.nio.channels.ReadableByteChannel; | |
import java.nio.channels.WritableByteChannel; |
This file contains 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
import static com.iaglimited.testing.util.GetterSetterTestProvider.shouldSetAndGet; | |
import org.junit.Test; | |
import com.iaglimited.testing.util.GetterSetterTestFilter; | |
public class GetAndSetExampleTest { | |
@Test | |
public void shouldSupportCorectGetterSetterBehaviour() { |
This file contains 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
import org.specs2.mutable._ | |
import org.junit.runner._ | |
import org.specs2.runner._ | |
@RunWith(classOf[JUnitRunner]) | |
class PrimeSpec extends Specification { | |
"The 'Prime' object" should { | |
"determine prime" in { | |
Prime.is(7919) must beTrue |
This file contains 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
// Find character with largest Unicode value | |
"Hello".reduceLeft((x, y) => if(x > y) x else y) | |
// Sum the unicode numeric value of the characters in "Hello World" | |
println("Hello World".foldLeft(0)((x, y) => x + y)) | |
// Filter characters with even Unicode values | |
"Hello".filter(c => c % 2 == 0) // Filter characters with even Unicode values | |
"Hello".filter(_ % 2 == 0) |
This file contains 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
import org.junit.Before; | |
import org.junit.runner.RunWith; | |
import org.mockito.Mock; | |
import org.mockito.runners.MockitoJUnitRunner; | |
import org.springframework.test.util.ReflectionTestUtils; | |
@RunWith(MockitoJUnitRunner.class) | |
public class ReflectionTestUtilsExampleTest { | |
@Mock private SomeDependency mockSomeDependency; |
This file contains 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
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.util.Arrays; | |
import java.util.List; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.core.io.Resource; |
This file contains 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
import org.junit.Before; | |
import org.junit.runner.RunWith; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.core.io.Resource; | |
import org.springframework.jdbc.core.JdbcTemplate; | |
import org.springframework.test.context.ContextConfiguration; | |
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | |
@RunWith(SpringJUnit4ClassRunner.class) | |
@ContextConfiguration({ |
NewerOlder