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
JAVA_HOME=/usr/java/default |
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
[git][* master]:$ bundle exec rake [~/pact-example/animal-service] | |
SPEC_OPTS='' /home/vagrant/.rbenv/versions/2.3.3/bin/ruby -S pact verify --pact-helper /home/vagrant/pact-example/animal-service/spec/service_consumers/pact_helper.rb | |
Reading pact at /home/vagrant/pact-example/animal-service/spec/service_consumers/pacts/zoo_app-animal_service.json | |
An error occurred in a `before(:suite)` hook. | |
Failure/Error: raise "Could not find config.ru file at #{Pact.configuration.config_ru_path} Please configure the service provider app or create a config.ru file in the root directory of the project. See https://github.com/realestate-com-au/pact/blob/master/documentation/verifying-pacts.md for more information." | |
RuntimeError: | |
Could not find config.ru file at ./config.ru Please configure the service provider app or create a config.ru file in the root directory of the project. See https://github.com/realestate-com-au/pact/blob/master/documentation/verifying-pacts.md for more infor |
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
[git][* master]:$ bundle exec rake [~/pact-example/animal-service] | |
SPEC_OPTS='' /home/vagrant/.rbenv/versions/2.3.3/bin/ruby -S pact verify --pact-helper /home/vagrant/pact-example/animal-service/spec/service_consumers/pact_helper.rb | |
Reading pact at /home/vagrant/pact-example/animal-service/spec/service_consumers/pacts/zoo_app-animal_service.json | |
An error occurred in a `before(:suite)` hook. | |
Failure/Error: raise "Could not find config.ru file at #{Pact.configuration.config_ru_path} Please configure the service provider app or create a config.ru file in the root directory of the project. See https://github.com/realestate-com-au/pact/blob/master/documentation/verifying-pacts.md for more information." | |
RuntimeError: | |
Could not find config.ru file at ./config.ru Please configure the service provider app or create a config.ru file in the root directory of the project. See https://github.com/realestate-com-au/pact/blob/master/documentation/verifying-pacts.md for more infor |
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
[git][* master]:$ bundle exec rspec spec/service_providers/animal_service_client_spec.rb [~/pact-example/zoo-app] | |
F | |
Failures: | |
1) AnimalServiceClient get_alligator returns a alligator | |
Got 1 failure and 1 other error: | |
1.1) Failure/Error: expect(subject.get_alligator).to eq(Alligator.new('Betty')) |
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
{ | |
"consumer": { | |
"name": "Zoo App" | |
}, | |
"provider": { | |
"name": "Animal Service" | |
}, | |
"interactions": [ | |
{ | |
"description": "a request for an alligator", |
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.util.HashMap; | |
import java.util.Map; | |
public class PrivateMethod { | |
// 結果が入っているとしましょう | |
private int result = new HashMap<String, String>(); | |
public void execute(){ | |
this.result = doExecute(); |
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.util.HashMap; | |
import java.util.Map; | |
public class PrivateMethod { | |
// 結果が入っているとしましょう | |
private int result = new HashMap<String, String>(); | |
public void execute(){ | |
doExecute(); |
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 jp.fieldnotes.sample.singleton; | |
import org.hamcrest.CoreMatchers; | |
import org.hamcrest.MatcherAssert; | |
import org.junit.Test; | |
import java.math.BigDecimal; | |
import static org.mockito.Mockito.*; | |
import static org.junit.Assert.*; |
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 jp.fieldnotes.sample.singleton; | |
import java.math.BigDecimal; | |
/*: | |
* 消費税率を返します。実際にはデータベースのマスター等から期間に応じて適用税率を返すことになります。<br/> | |
* 諸外国にある小数点以下の桁を含む税率には対応しましたが、軽減税率はちょっと本題を外れるのでオミット。 | |
*/ | |
public class TaxSingleton { |
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 jp.fieldnotes.sample.singleton; | |
import java.math.BigDecimal; | |
import java.math.MathContext; | |
import java.math.RoundingMode; | |
public class Calculator { | |
TaxSingleton singleton = TaxSingleton.getInstance(); |
NewerOlder