Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.bouncycastle.cms.SignerInformation;
- public class SignerInformationConsumer {
- public String interact(SignerInformation si) {
- return si.getDigestAlgOID();
- }
- }
- import org.bouncycastle.cms.SignerInformation
- import spock.lang.Shared
- import spock.lang.Specification
- class SignerInformationConsumerTest extends Specification {
- @Shared
- SignerInformation si = Mock()
- def "should return valid array"() {
- given:
- SignerInformationConsumer test = new SignerInformationConsumer()
- si.digestAlgOID >> "aaa"
- when:
- String digest = test.interact(si)
- then:
- digest == "aaa"
- }
- }
- plugins {
- id 'java'
- }
- group 'test'
- version '1.0-SNAPSHOT'
- sourceCompatibility = 1.8
- repositories {
- mavenCentral()
- }
- dependencies {
- testCompile group: 'org.spockframework', name: 'spock-core', version: '1.1-groovy-2.4'
- testCompile 'net.bytebuddy:byte-buddy:1.8.0'
- compile group: 'org.bouncycastle', name: 'bcpkix-jdk15on', version: '1.60'
- }
Add Comment
Please, Sign In to add comment