killbill-invoice-test 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: efd76145a08d1a8a77e25c8db7354c35e577693f
4
- data.tar.gz: 781141fa8366ac46b03c0812a2fdefa02a376c8b
3
+ metadata.gz: 6f912d24508f01d52c7ba9ddd134d1e6809f15ba
4
+ data.tar.gz: 0ef093f2652ab1141aba5596dcb1b89f8e20007d
5
5
  SHA512:
6
- metadata.gz: 4ac6204c17a9c0cbf4f80ac5e9324b0272ac5ea536cacf614269dad648d8ce63858e78a5b8c59d45c177c286e02f01cee3f33cc6ebc1e62031fed34a773a7d20
7
- data.tar.gz: 75c27c9904bfd3ab6169b55eead9a8f4c061a11ab47d634d45e5fbbcb1af094db38ba49b47f5635bba00e42a2f3757080894e6b2d733b214de1e45473cad16bc
6
+ metadata.gz: 8bc12ee32d0bdc9de0c5d05181d95bf01beb2c698a0e0c8c7b1354b0240c3a4902a0c1ef18155b9485c5d4a2e9c62e713bfd5c9a3bd2608f5e01123fb3ad4d33
7
+ data.tar.gz: 1562c6406a3700af7ae84e25e1960675180db66edbc683585c26733bf8e8bde80fbf20d48c614541052dea3dd3912c1a262489f95d38ecd2906b407185b4bebe
@@ -5,7 +5,7 @@ module InvoiceTest
5
5
  # This implementation is idempotent, will apply tax on old invoices if needed
6
6
  # and automatically handle adjustments
7
7
  def get_additional_invoice_items(new_invoice, dry_run, properties, context)
8
- all_invoices = @kb_apis.invoice_user_api.get_invoices_by_account(new_invoice.account_id, false, context)
8
+ all_invoices = @kb_apis.invoice_user_api.get_invoices_by_account(new_invoice.account_id, false, false, context)
9
9
  # Workaround for https://github.com/killbill/killbill/issues/265
10
10
  all_invoices << new_invoice unless all_invoices.find { |inv| inv.id == new_invoice.id }
11
11
 
metadata CHANGED
@@ -1,117 +1,108 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-invoice-test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kill Bill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-21 00:00:00.000000000 Z
11
+ date: 2018-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: killbill
15
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: '8.0'
20
14
  requirement: !ruby/object:Gem::Requirement
21
15
  requirements:
22
- - - ~>
16
+ - - "~>"
23
17
  - !ruby/object:Gem::Version
24
- version: '8.0'
18
+ version: '9.4'
19
+ name: killbill
25
20
  prerelease: false
26
21
  type: :runtime
27
- - !ruby/object:Gem::Dependency
28
- name: jbundler
29
22
  version_requirements: !ruby/object:Gem::Requirement
30
23
  requirements:
31
- - - ~>
24
+ - - "~>"
32
25
  - !ruby/object:Gem::Version
33
- version: 0.9.2
26
+ version: '9.4'
27
+ - !ruby/object:Gem::Dependency
34
28
  requirement: !ruby/object:Gem::Requirement
35
29
  requirements:
36
- - - ~>
30
+ - - "~>"
37
31
  - !ruby/object:Gem::Version
38
32
  version: 0.9.2
33
+ name: jbundler
39
34
  prerelease: false
40
35
  type: :development
41
- - !ruby/object:Gem::Dependency
42
- name: rake
43
36
  version_requirements: !ruby/object:Gem::Requirement
44
37
  requirements:
45
- - - '>='
38
+ - - "~>"
46
39
  - !ruby/object:Gem::Version
47
- version: 10.0.0
40
+ version: 0.9.2
41
+ - !ruby/object:Gem::Dependency
48
42
  requirement: !ruby/object:Gem::Requirement
49
43
  requirements:
50
- - - '>='
44
+ - - ">="
51
45
  - !ruby/object:Gem::Version
52
46
  version: 10.0.0
47
+ - - "<"
48
+ - !ruby/object:Gem::Version
49
+ version: 11.0.0
50
+ name: rake
53
51
  prerelease: false
54
52
  type: :development
55
- - !ruby/object:Gem::Dependency
56
- name: rspec
57
53
  version_requirements: !ruby/object:Gem::Requirement
58
54
  requirements:
59
- - - ~>
55
+ - - ">="
60
56
  - !ruby/object:Gem::Version
61
- version: 2.12.0
57
+ version: 10.0.0
58
+ - - "<"
59
+ - !ruby/object:Gem::Version
60
+ version: 11.0.0
61
+ - !ruby/object:Gem::Dependency
62
62
  requirement: !ruby/object:Gem::Requirement
63
63
  requirements:
64
- - - ~>
64
+ - - "~>"
65
65
  - !ruby/object:Gem::Version
66
- version: 2.12.0
66
+ version: 3.5.0
67
+ name: rspec
67
68
  prerelease: false
68
69
  type: :development
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: 3.5.0
69
75
  description: Kill Bill Plugin to test the invoice plugin api.
70
76
  email: killbilling-users@googlegroups.com
71
77
  executables: []
72
78
  extensions: []
73
79
  extra_rdoc_files: []
74
80
  files:
75
- - .gitignore
76
- - .travis.yml
77
- - Gemfile
78
- - Gemfile.lock
79
- - Jarfile
80
- - Jarfile.lock
81
- - README.md
82
- - Rakefile
83
- - VERSION
84
- - killbill-invoice-test.gemspec
85
- - killbill.properties
86
81
  - lib/invoice_test.rb
87
82
  - lib/invoice_test/api.rb
88
- - pom.xml
89
- - release.sh
90
- - spec/invoice_test/base_plugin_spec.rb
91
- - spec/spec_helper.rb
92
83
  homepage: http://killbill.io
93
84
  licenses:
94
85
  - Apache License (2.0)
95
86
  metadata: {}
96
87
  post_install_message:
97
88
  rdoc_options:
98
- - --exclude
99
- - .
89
+ - "--exclude"
90
+ - "."
100
91
  require_paths:
101
92
  - lib
102
93
  required_ruby_version: !ruby/object:Gem::Requirement
103
94
  requirements:
104
- - - '>='
95
+ - - ">="
105
96
  - !ruby/object:Gem::Version
106
97
  version: 1.9.3
107
98
  required_rubygems_version: !ruby/object:Gem::Requirement
108
99
  requirements:
109
- - - '>='
100
+ - - ">="
110
101
  - !ruby/object:Gem::Version
111
102
  version: '0'
112
103
  requirements: []
113
104
  rubyforge_project:
114
- rubygems_version: 2.4.6
105
+ rubygems_version: 2.4.8
115
106
  signing_key:
116
107
  specification_version: 4
117
108
  summary: Plugin to test the invoice plugin api.
data/.gitignore DELETED
@@ -1,33 +0,0 @@
1
- *.gem
2
- *.rbc
3
- *.swp
4
- .bundle
5
- .config
6
- coverage
7
- InstalledFiles
8
- lib/bundler/man
9
- pkg
10
- rdoc
11
- spec/reports
12
- test/tmp
13
- test/version_tmp
14
- tmp
15
-
16
- # YARD artifacts
17
- .yardoc
18
- _yardoc
19
- doc/
20
-
21
- .jbundler
22
-
23
- .DS_Store
24
-
25
- # Testing database
26
- test.db
27
-
28
- target
29
- pom.xml.asc
30
-
31
- .idea/
32
-
33
- Gemfile.head.lock
@@ -1,41 +0,0 @@
1
- language: ruby
2
-
3
- sudo: false
4
- cache: bundler
5
-
6
- before_script:
7
- - bundle exec jbundle install
8
-
9
- script: 'bundle exec rake spec'
10
-
11
- notifications:
12
- email:
13
- - kill-bill-commits@googlegroups.com
14
-
15
- env:
16
- global:
17
- - JRUBY_OPTS='-J-Xmx1024M'
18
-
19
- rvm:
20
- - jruby-1.7.20
21
- - jruby-20mode # latest 1.7.x
22
- - jruby-head
23
-
24
- gemfile:
25
- - Gemfile
26
- - Gemfile.head
27
-
28
- jdk:
29
- - openjdk7
30
- - oraclejdk7
31
- - oraclejdk8
32
-
33
- matrix:
34
- allow_failures:
35
- - rvm: jruby-head
36
- - jdk: oraclejdk8
37
- - gemfile: Gemfile.head
38
- fast_finish: true
39
-
40
- after_success:
41
- - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && echo "<settings><servers><server><id>sonatype-nexus-snapshots</id><username>\${env.OSSRH_USER}</username><password>\${env.OSSRH_PASS}</password></server></servers></settings>" > ~/settings.xml && MVN="mvn --settings $HOME/settings.xml" NO_RELEASE=1 travis_retry travis_wait bash release.sh | egrep -v "Download|Install|Upload" ; rm -f ~/settings.xml'
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
4
- #gem 'killbill', :github => 'killbill/killbill-plugin-framework-ruby'
@@ -1,78 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- killbill-invoice-test (0.2.0)
5
- killbill (~> 8.0)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- axiom-types (0.1.1)
11
- descendants_tracker (~> 0.0.4)
12
- ice_nine (~> 0.11.0)
13
- thread_safe (~> 0.3, >= 0.3.1)
14
- coercible (1.0.0)
15
- descendants_tracker (~> 0.0.1)
16
- descendants_tracker (0.0.4)
17
- thread_safe (~> 0.3, >= 0.3.1)
18
- diff-lcs (1.1.3)
19
- equalizer (0.0.11)
20
- ethon (0.9.1)
21
- ffi (>= 1.3.0)
22
- ffi (1.9.14-java)
23
- ice_nine (0.11.1)
24
- jar-dependencies (0.3.1)
25
- jbundler (0.9.2)
26
- bundler (~> 1.5)
27
- jar-dependencies (~> 0.2)
28
- maven-tools (~> 1.0.10)
29
- ruby-maven (~> 3.3, >= 3.3.3)
30
- killbill (8.3.1)
31
- rack (>= 1.5.2)
32
- sinatra (~> 1.3.4)
33
- typhoeus (~> 0.6.9)
34
- tzinfo (~> 1.2.0)
35
- maven-tools (1.0.13)
36
- virtus (~> 1.0)
37
- rack (1.6.5)
38
- rack-protection (1.5.3)
39
- rack
40
- rake (10.4.2)
41
- rspec (2.12.0)
42
- rspec-core (~> 2.12.0)
43
- rspec-expectations (~> 2.12.0)
44
- rspec-mocks (~> 2.12.0)
45
- rspec-core (2.12.2)
46
- rspec-expectations (2.12.1)
47
- diff-lcs (~> 1.1.3)
48
- rspec-mocks (2.12.2)
49
- ruby-maven (3.3.8)
50
- ruby-maven-libs (~> 3.3.1)
51
- ruby-maven-libs (3.3.3)
52
- sinatra (1.3.6)
53
- rack (~> 1.4)
54
- rack-protection (~> 1.3)
55
- tilt (~> 1.3, >= 1.3.3)
56
- thread_safe (0.3.5-java)
57
- tilt (1.4.1)
58
- typhoeus (0.6.9)
59
- ethon (>= 0.7.1)
60
- tzinfo (1.2.2)
61
- thread_safe (~> 0.1)
62
- virtus (1.0.5)
63
- axiom-types (~> 0.1)
64
- coercible (~> 1.0)
65
- descendants_tracker (~> 0.0, >= 0.0.3)
66
- equalizer (~> 0.0, >= 0.0.9)
67
-
68
- PLATFORMS
69
- java
70
-
71
- DEPENDENCIES
72
- jbundler (~> 0.9.2)
73
- killbill-invoice-test!
74
- rake (>= 10.0.0)
75
- rspec (~> 2.12.0)
76
-
77
- BUNDLED WITH
78
- 1.11.2
data/Jarfile DELETED
@@ -1,12 +0,0 @@
1
- jar 'org.kill-bill.billing:killbill-api', '0.50'
2
- jar 'org.kill-bill.billing.plugin:killbill-plugin-api-currency', '0.23'
3
- jar 'org.kill-bill.billing.plugin:killbill-plugin-api-invoice', '0.23'
4
- jar 'org.kill-bill.billing.plugin:killbill-plugin-api-notification', '0.23'
5
- jar 'org.kill-bill.billing.plugin:killbill-plugin-api-payment', '0.23'
6
- jar 'org.kill-bill.billing.plugin:killbill-plugin-api-control', '0.23'
7
- jar 'org.kill-bill.billing.plugin:killbill-plugin-api-catalog', '0.23'
8
- jar 'org.kill-bill.billing.plugin:killbill-plugin-api-entitlement', '0.23'
9
- jar 'org.kill-bill.billing:killbill-util:tests', '0.18.0'
10
- jar 'org.kill-bill.billing:killbill-util', '0.18.0'
11
- jar 'org.mockito:mockito-all', '1.10.19'
12
- jar 'javax.servlet:javax.servlet-api', '3.1.0'
@@ -1,66 +0,0 @@
1
- ---
2
- :runtime:
3
- - io.dropwizard.metrics:metrics-core:jar:3.1.1
4
- - joda-time:joda-time:jar:2.3
5
- - org.weakref:jmxutils:jar:1.18
6
- - commons-beanutils:commons-beanutils:jar:1.8.3
7
- - com.google.inject:guice:jar:3.0
8
- - org.osgi:org.osgi.core:jar:5.0.0
9
- - com.fasterxml.jackson.core:jackson-databind:jar:2.4.5
10
- - org.kill-bill.billing.plugin:killbill-plugin-api-currency:jar:0.23
11
- - org.kill-bill.billing:killbill-platform-api:jar:0.36.1
12
- - com.samskivert:jmustache:jar:1.5
13
- - org.kill-bill.commons:killbill-clock:jar:0.20
14
- - org.kill-bill.billing:killbill-util:jar:0.18.0
15
- - com.fasterxml.jackson.dataformat:jackson-dataformat-csv:jar:2.4.5
16
- - org.bouncycastle:bcpkix-jdk15on:jar:1.55
17
- - org.bouncycastle:bcprov-jdk15on:jar:1.55
18
- - org.kill-bill.billing.plugin:killbill-plugin-api-entitlement:jar:0.23
19
- - org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4:jar:1.16
20
- - com.h2database:h2:jar:1.4.186
21
- - com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.4.5
22
- - javax.activation:activation:jar:1.1
23
- - org.skife.config:config-magic:jar:0.14
24
- - org.javassist:javassist:jar:3.19.0-GA
25
- - org.mockito:mockito-all:jar:1.10.19
26
- - org.apache.commons:commons-email:jar:1.2
27
- - antlr:antlr:jar:2.7.7
28
- - aopalliance:aopalliance:jar:1.0
29
- - com.zaxxer:HikariCP-java6:jar:2.3.7
30
- - org.slf4j:slf4j-api:jar:1.7.21
31
- - com.fasterxml.jackson.core:jackson-annotations:jar:2.4.3
32
- - org.antlr:stringtemplate:jar:3.2.1
33
- - org.slf4j:jcl-over-slf4j:jar:1.7.21
34
- - javax.mail:mail:jar:1.4.1
35
- - io.dropwizard.metrics:metrics-ehcache:jar:3.1.1
36
- - org.jdbi:jdbi:jar:2.62
37
- - com.fasterxml.jackson.core:jackson-core:jar:2.4.5
38
- - org.apache.felix:org.apache.felix.framework:jar:4.4.1
39
- - org.joda:joda-money:jar:0.9
40
- - org.kill-bill.billing.plugin:killbill-plugin-api-payment:jar:0.23
41
- - org.apache.shiro:shiro-core:jar:1.2.3
42
- - org.kill-bill.billing:killbill-internal-api:jar:0.18.0
43
- - org.kill-bill.billing:killbill-util:jar:tests:0.18.0
44
- - org.kill-bill.billing.plugin:killbill-plugin-api-control:jar:0.23
45
- - org.kill-bill.commons:killbill-jdbi:jar:0.20
46
- - com.google.guava:guava:jar:r09
47
- - org.kill-bill.commons:killbill-queue:jar:0.20
48
- - org.osgi:org.osgi.compendium:jar:5.0.0
49
- - org.kill-bill.commons:killbill-xmlloader:jar:0.20
50
- - javax.servlet:javax.servlet-api:jar:3.1.0
51
- - org.kill-bill.billing:killbill-platform-osgi:jar:0.36.1
52
- - org.apache.shiro:shiro-ehcache:jar:1.2.3
53
- - org.kill-bill.billing:killbill-platform-base:jar:0.36.1
54
- - javax.inject:javax.inject:jar:1
55
- - org.kill-bill.billing.plugin:killbill-plugin-api-invoice:jar:0.23
56
- - org.kill-bill.billing:killbill-api:jar:0.50
57
- - com.google.inject.extensions:guice-multibindings:jar:3.0
58
- - org.kill-bill.billing:killbill-platform-osgi-api:jar:0.36.1
59
- - net.sf.ehcache:ehcache:jar:2.9.1
60
- - org.kill-bill.commons:killbill-locker:jar:0.20
61
- - org.kill-bill.commons:killbill-embeddeddb-common:jar:0.20
62
- - org.apache.shiro:shiro-guice:jar:1.2.3
63
- - com.google.code.findbugs:annotations:jar:3.0.0
64
- - org.kill-bill.billing.plugin:killbill-plugin-api-notification:jar:0.23
65
- - org.kill-bill.billing.plugin:killbill-plugin-api-catalog:jar:0.23
66
- - org.kill-bill.commons:killbill-concurrent:jar:0.20
data/README.md DELETED
@@ -1,14 +0,0 @@
1
- killbill-invoice-test-plugin
2
- ============================
3
-
4
- Plugin to test the Kill Bill InvoicePlugin API.
5
-
6
- Release builds are available on [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.kill-bill.billing.plugin.ruby%22%20AND%20a%3A%22invoice-test-plugin%22) with coordinates `org.kill-bill.billing.plugin.ruby:invoice-test-plugin`.
7
-
8
- Kill Bill compatibility
9
- -----------------------
10
-
11
- | Plugin version | Kill Bill version |
12
- | -------------: | ----------------: |
13
- | 0.1.y | 0.16.z |
14
- | 0.2.y | 0.18.z |
data/Rakefile DELETED
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env rake
2
-
3
- # Install tasks to build and release the plugin
4
- require 'bundler/setup'
5
- Bundler::GemHelper.install_tasks
6
-
7
- # Install test tasks
8
- require 'rspec/core/rake_task'
9
- desc "Run RSpec"
10
- RSpec::Core::RakeTask.new
11
-
12
- # Install tasks to package the plugin for Killbill
13
- require 'killbill/rake_task'
14
- Killbill::PluginHelper.install_tasks
15
-
16
- # Run tests by default
17
- task :default => :spec
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.2.0
@@ -1,30 +0,0 @@
1
- version = File.read(File.expand_path('../VERSION', __FILE__)).strip
2
-
3
- Gem::Specification.new do |s|
4
- s.name = 'killbill-invoice-test'
5
- s.version = version
6
- s.summary = 'Plugin to test the invoice plugin api.'
7
- s.description = 'Kill Bill Plugin to test the invoice plugin api.'
8
-
9
- s.required_ruby_version = '>= 1.9.3'
10
-
11
- s.license = 'Apache License (2.0)'
12
-
13
- s.author = 'Kill Bill core team'
14
- s.email = 'killbilling-users@googlegroups.com'
15
- s.homepage = 'http://killbill.io'
16
-
17
- s.files = `git ls-files`.split("\n")
18
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
- s.bindir = 'bin'
20
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
- s.require_paths = ["lib"]
22
-
23
- s.rdoc_options << '--exclude' << '.'
24
-
25
- s.add_dependency 'killbill', '~> 8.0'
26
-
27
- s.add_development_dependency 'jbundler', '~> 0.9.2'
28
- s.add_development_dependency 'rake', '>= 10.0.0'
29
- s.add_development_dependency 'rspec', '~> 2.12.0'
30
- end
@@ -1,3 +0,0 @@
1
- mainClass=InvoiceTest::InvoicePlugin
2
- require=invoice_test
3
- pluginType=INVOICE
data/pom.xml DELETED
@@ -1,38 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!--
3
- ~ Copyright 2010-2013 Ning, Inc.
4
- ~ Copyright 2014-2015 Groupon, Inc
5
- ~ Copyright 2014-2015 The Billing Project, LLC
6
- ~
7
- ~ The Billing Project licenses this file to you under the Apache License, version 2.0
8
- ~ (the "License"); you may not use this file except in compliance with the
9
- ~ License. You may obtain a copy of the License at:
10
- ~
11
- ~ http://www.apache.org/licenses/LICENSE-2.0
12
- ~
13
- ~ Unless required by applicable law or agreed to in writing, software
14
- ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15
- ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16
- ~ License for the specific language governing permissions and limitations
17
- ~ under the License.
18
- -->
19
-
20
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21
- <parent>
22
- <groupId>org.sonatype.oss</groupId>
23
- <artifactId>oss-parent</artifactId>
24
- <version>5</version>
25
- </parent>
26
- <modelVersion>4.0.0</modelVersion>
27
- <groupId>org.kill-bill.billing.plugin.ruby</groupId>
28
- <artifactId>invoice-test-plugin</artifactId>
29
- <packaging>pom</packaging>
30
- <version>0.2.0</version>
31
- <name>invoice-test-plugin</name>
32
- <description></description>
33
- <scm>
34
- <connection>scm:git:git://github.com/killbill/killbill-invoice-test-plugin.git</connection>
35
- <url>https://github.com/killbill/killbill-invoice-test-plugin/</url>
36
- <developerConnection>scm:git:git@github.com:killbill/killbill-invoice-test-plugin.git</developerConnection>
37
- </scm>
38
- </project>
data/release.sh DELETED
@@ -1,61 +0,0 @@
1
- set -e
2
-
3
- BUNDLE=${BUNDLE-"bundle exec"}
4
- MVN=${MVN-"mvn"}
5
-
6
- if [ 'GNU' != "$(tar --help | grep GNU | head -1 | awk '{print $1}')" ]; then
7
- echo 'Unable to release: make sure to use GNU tar'
8
- exit 1
9
- fi
10
-
11
- if $(ruby -e'require "java"'); then
12
- # Good
13
- echo 'Detected JRuby'
14
- else
15
- echo 'Unable to release: make sure to use JRuby'
16
- exit 1
17
- fi
18
-
19
- VERSION=`grep -E '<version>([0-9]+\.[0-9]+\.[0-9]+)</version>' pom.xml | sed 's/[\t \n]*<version>\(.*\)<\/version>[\t \n]*/\1/'`
20
- if [[ -z "$NO_RELEASE" && "$VERSION" != "$(cat $PWD/VERSION)" ]]; then
21
- echo 'Unable to release: make sure the versions in pom.xml and VERSION match'
22
- exit 1
23
- fi
24
-
25
- echo 'Cleaning up'
26
- $BUNDLE rake killbill:clean
27
-
28
- echo 'Building gem'
29
- $BUNDLE rake build
30
-
31
- if [[ -z "$NO_RELEASE" ]]; then
32
- echo 'Pushing the gem to Rubygems'
33
- $BUNDLE rake release
34
- fi
35
-
36
- echo 'Building artifact'
37
- $BUNDLE rake killbill:package
38
-
39
- ARTIFACT="$PWD/pkg/killbill-invoice-test-$VERSION.tar.gz"
40
- echo "Pushing $ARTIFACT to Maven Central"
41
-
42
- if [[ -z "$NO_RELEASE" ]]; then
43
- GOAL=gpg:sign-and-deploy-file
44
- REPOSITORY_ID=ossrh-releases
45
- URL=https://oss.sonatype.org/service/local/staging/deploy/maven2/
46
- else
47
- GOAL=deploy:deploy-file
48
- REPOSITORY_ID=sonatype-nexus-snapshots
49
- URL=https://oss.sonatype.org/content/repositories/snapshots/
50
- VERSION="$VERSION-SNAPSHOT"
51
- fi
52
-
53
- $MVN $GOAL \
54
- -DgroupId=org.kill-bill.billing.plugin.ruby \
55
- -DartifactId=invoice-test-plugin \
56
- -Dversion=$VERSION \
57
- -Dpackaging=tar.gz \
58
- -DrepositoryId=$REPOSITORY_ID \
59
- -Durl=$URL \
60
- -Dfile=$ARTIFACT \
61
- -DpomFile=pom.xml
@@ -1,116 +0,0 @@
1
- require 'spec_helper'
2
- require 'logger'
3
-
4
- describe InvoiceTest::InvoicePlugin do
5
-
6
- class FakeJavaInvoiceUserApi
7
- attr_accessor :invoices
8
-
9
- def get_invoices_by_account(accountId, includesMigrated, context)
10
- @invoices
11
- end
12
- end
13
-
14
- before(:each) do
15
- @invoice_api = FakeJavaInvoiceUserApi.new
16
- kb_apis = Killbill::Plugin::KillbillApi.new('killbill-invoice-test', {:invoice_user_api => @invoice_api})
17
-
18
- @plugin = InvoiceTest::InvoicePlugin.new
19
- @plugin.logger = Logger.new(STDOUT)
20
- @plugin.kb_apis = kb_apis
21
-
22
- @properties = []
23
- @call_context = nil
24
- end
25
-
26
- it 'should start and stop correctly' do
27
- @plugin.start_plugin
28
- @plugin.stop_plugin
29
- end
30
-
31
- it 'should add two additional items' do
32
- fixed_item = build_invoice_item(100, :FIXED)
33
- recurring_item = build_invoice_item(150, :RECURRING)
34
- invoice = build_invoice([fixed_item, recurring_item])
35
-
36
- new_items = @plugin.get_additional_invoice_items(invoice, false, @properties, @call_context)
37
- new_items.size.should == 2
38
-
39
- check_invoice_item(new_items[0], 7, fixed_item)
40
- check_invoice_item(new_items[1], 10.5, recurring_item)
41
-
42
- check_idempotency(invoice, new_items)
43
- end
44
-
45
- it 'should add no additional item' do
46
- fixed_item = build_invoice_item(100, :FIXED)
47
- recurring_item = build_invoice_item(150, :RECURRING)
48
- recurring_adj_item = build_invoice_item(-150, :ITEM_ADJ, recurring_item.id)
49
- fixed_adj_item = build_invoice_item(-100, :ITEM_ADJ, fixed_item.id)
50
- invoice = build_invoice([fixed_item, recurring_item, recurring_adj_item, fixed_adj_item])
51
-
52
- new_items = @plugin.get_additional_invoice_items(invoice, false, @properties, @call_context)
53
- new_items.size.should == 0
54
-
55
- check_idempotency(invoice, new_items)
56
- end
57
-
58
- it 'should add a single additional item' do
59
- fixed_item = build_invoice_item(100, :FIXED)
60
- recurring_item = build_invoice_item(150, :RECURRING)
61
- fixed_adj_item = build_invoice_item(-100, :ITEM_ADJ, fixed_item.id)
62
- invoice = build_invoice([fixed_item, recurring_item, fixed_adj_item])
63
-
64
- new_items = @plugin.get_additional_invoice_items(invoice, false, @properties, @call_context)
65
- new_items.size.should == 1
66
-
67
- check_invoice_item(new_items[0], 10.5, recurring_item)
68
-
69
- check_idempotency(invoice, new_items)
70
- end
71
-
72
- it 'should handle partial adjustments' do
73
- fixed_item = build_invoice_item(100, :FIXED)
74
- tax_item = build_invoice_item(7, :TAX, fixed_item.id)
75
- fixed_adj_item = build_invoice_item(-20, :ITEM_ADJ, fixed_item.id)
76
- invoice = build_invoice([fixed_item, tax_item, fixed_adj_item])
77
-
78
- new_items = @plugin.get_additional_invoice_items(invoice, false, @properties, @call_context)
79
- new_items.size.should == 1
80
-
81
- check_invoice_item(new_items[0], -1.4, tax_item, :ITEM_ADJ)
82
-
83
- check_idempotency(invoice, new_items)
84
- end
85
-
86
- private
87
-
88
- def build_invoice(items)
89
- invoice = Killbill::Plugin::Model::Invoice.new
90
- invoice.id = SecureRandom.uuid
91
- invoice.invoice_items = items
92
- invoice
93
- end
94
-
95
- def build_invoice_item(amount, invoice_item_type=:FIXED, linked_item_id=nil)
96
- item = Killbill::Plugin::Model::InvoiceItem.new
97
- item.id = SecureRandom.uuid
98
- item.amount = amount
99
- item.invoice_item_type = invoice_item_type
100
- item.linked_item_id = linked_item_id
101
- item
102
- end
103
-
104
- def check_invoice_item(item, amount, original_item, invoice_item_type=:TAX)
105
- item.should be_an_instance_of Killbill::Plugin::Model::InvoiceItem
106
- item.amount.should == amount
107
- item.invoice_item_type.should == invoice_item_type
108
- item.linked_item_id.should == original_item.id
109
- end
110
-
111
- def check_idempotency(original_invoice, new_items)
112
- invoice = build_invoice(original_invoice.invoice_items + new_items)
113
- additional_items = @plugin.get_additional_invoice_items(invoice, false, @properties, @call_context)
114
- additional_items.size.should == 0
115
- end
116
- end
@@ -1,10 +0,0 @@
1
- require 'bundler'
2
- require 'rspec'
3
-
4
- require 'invoice_test'
5
-
6
- RSpec.configure do |config|
7
- config.color_enabled = true
8
- config.tty = true
9
- config.formatter = 'documentation'
10
- end