# File lib/rhc/rest/mock.rb, line 241
    def add_application(name, type=nil, scale=nil, gear_profile='default')
      if type.is_a?(Hash)
        scale = type[:scale]
        gear_profile = type[:gear_profile]
        type = type[:cartridge]
      end
      a = MockRestApplication.new(name, type, self, scale, gear_profile)
      builder = @applications.find{ |app| app.cartridges.map(&:name).any?{ |s| s =~ /^jenkins-[\d\.]+$/ } }
      a.building_app = builder.name if builder
      @applications << a
      a.add_message("Success")
      a
    end