mattermost/server/einterfaces/mocks/LicenseInterface.go

108 lines
2.4 KiB
Go
Raw Permalink Normal View History

Upgrade Go to 1.24.3 (#31220) * Upgrade Go to 1.24.3 Updates the following files: - server/.go-version: 1.23.9 → 1.24.3 - server/build/Dockerfile.buildenv: golang:1.23.9-bullseye → golang:1.24.3-bullseye - server/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3 - server/public/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3 Also fixes non-constant format string errors introduced by Go 1.24.3's stricter format string checking: - Added response() helper function in slashcommands/util.go for simple string responses - Removed unused responsef() function from slashcommands/util.go - Replaced responsef() with response() for translated strings that don't need formatting - Fixed fmt.Errorf and fmt.Fprintf calls to use proper format verbs instead of string concatenation - Updated marketplace buildURL to handle format strings conditionally 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Update generated mocks for Go 1.24.3 Regenerated mocks using mockery v2.53.4 to ensure compatibility with Go 1.24.3. This addresses mock generation failures that occurred with the Go upgrade. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Update to bookworm and fix non-existent sha Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com> * fix non-constant format string --------- Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Stavros Foteinopoulos <stafot@gmail.com>
2025-06-10 14:04:57 -04:00
// Code generated by mockery v2.53.4. DO NOT EDIT.
MM-34437 Preventing infinite trial requests (#17472) * MM-34434: Added 'is_trial' boolean to all trial license requests and to the License struct. * MM-34434: Generalized the concept of a license request. * MM-34434: Verifies JSON field of license instance is set. * MM-34434: Added missing client param. * MM-34434: Added some tests of the request trial API endpoint. * MM-34434: Removed comment. * fix broken test (#17348) * Add missing wrapped errors (#17339) * Improve document extraction and including a document extraction command (#17183) * Add extract documents content command * Adding the extraction command and making the pure go pdf library as secondary option * Improving the memory usage and docextractor interface * Enable content extraction by default in all the instances * Tiny improvement on archive indexing * Adding App interface generation and the opentracing layer * Fixing linter errors * Addressing PR review comments * Addressing PR review comments * Update en.json (#17356) Automatic Merge * adding new feature flag (#17308) Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> * Bump no_output_timeout to 2 hours (#17358) * log invalid username (#17345) Automatic Merge * MM-34434: Added missing client param. MM-34434: Added some tests of the request trial API endpoint. MM-34434: Removed comment. * MM-34434: Switched to a hard-coded true value. * MM-34434: Reverts test change. * MM-34434: Removes unnecessary field. * MM-34434: Tests that is_trial is hard-coded by TrialLicenseRequest. * MM-34434: Removed accidental commit. * MM-34434: Removes unnecessary is_trial key from JSON payload. * MM-34434: Reverts to old pointer receiver variable name. * MM-34434: Removes test. * #MM-34437 Initialized license service * ##MM-34437 Verified at all points if server is trial elligible * WIp * #MM-34437 removed unused commented code * MM-34437 make a log less severe * #MM-34437 generated einterface mocks * #MM-34437 added license on new file * #MM-34437 removed unused translation * #MM-34437 some refactoring * Update api4/license.go * Update api4/license.go * #MM-34437 made a variable name consistent * #MM-34437 Added mocks for lince validator * #M--34437 Added license validator test framework * #MM-34437 Renamed isTrial method to isTrialLicense to avoid conflict with newlya dded field * #M--34437 Allowed sales-sanctioned trials * #MM-34437 fixed trial license API tests * Added tests for add license API * #MM-34437 fixed ValidateLicense test * #MM-34437 Added util tests * #MM-34437 using NoError for checking no error * #MM-34437 using NoError for checking no error * Added dummy piblic key for testing * Fixed tests * #MM-34437 udpaetd trial license URL for testing * #MM-34437 adjusted times for licences generated through admin portal * Reverted test-only changes Co-authored-by: Martin Kraft <martin@upspin.org> Co-authored-by: Hossein <hahmadia@users.noreply.github.com> Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com> Co-authored-by: Jesús Espino <jespinog@gmail.com> Co-authored-by: Amy Blais <amy_blais@hotmail.com> Co-authored-by: Ben Cooke <benkcooke@gmail.com> Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in> Co-authored-by: Max Erenberg <max.erenberg@mattermost.com>
2021-06-17 08:07:34 -04:00
// Regenerate this file using `make einterfaces-mocks`.
package mocks
import (
model "github.com/mattermost/mattermost/server/public/model"
MM-34437 Preventing infinite trial requests (#17472) * MM-34434: Added 'is_trial' boolean to all trial license requests and to the License struct. * MM-34434: Generalized the concept of a license request. * MM-34434: Verifies JSON field of license instance is set. * MM-34434: Added missing client param. * MM-34434: Added some tests of the request trial API endpoint. * MM-34434: Removed comment. * fix broken test (#17348) * Add missing wrapped errors (#17339) * Improve document extraction and including a document extraction command (#17183) * Add extract documents content command * Adding the extraction command and making the pure go pdf library as secondary option * Improving the memory usage and docextractor interface * Enable content extraction by default in all the instances * Tiny improvement on archive indexing * Adding App interface generation and the opentracing layer * Fixing linter errors * Addressing PR review comments * Addressing PR review comments * Update en.json (#17356) Automatic Merge * adding new feature flag (#17308) Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> * Bump no_output_timeout to 2 hours (#17358) * log invalid username (#17345) Automatic Merge * MM-34434: Added missing client param. MM-34434: Added some tests of the request trial API endpoint. MM-34434: Removed comment. * MM-34434: Switched to a hard-coded true value. * MM-34434: Reverts test change. * MM-34434: Removes unnecessary field. * MM-34434: Tests that is_trial is hard-coded by TrialLicenseRequest. * MM-34434: Removed accidental commit. * MM-34434: Removes unnecessary is_trial key from JSON payload. * MM-34434: Reverts to old pointer receiver variable name. * MM-34434: Removes test. * #MM-34437 Initialized license service * ##MM-34437 Verified at all points if server is trial elligible * WIp * #MM-34437 removed unused commented code * MM-34437 make a log less severe * #MM-34437 generated einterface mocks * #MM-34437 added license on new file * #MM-34437 removed unused translation * #MM-34437 some refactoring * Update api4/license.go * Update api4/license.go * #MM-34437 made a variable name consistent * #MM-34437 Added mocks for lince validator * #M--34437 Added license validator test framework * #MM-34437 Renamed isTrial method to isTrialLicense to avoid conflict with newlya dded field * #M--34437 Allowed sales-sanctioned trials * #MM-34437 fixed trial license API tests * Added tests for add license API * #MM-34437 fixed ValidateLicense test * #MM-34437 Added util tests * #MM-34437 using NoError for checking no error * #MM-34437 using NoError for checking no error * Added dummy piblic key for testing * Fixed tests * #MM-34437 udpaetd trial license URL for testing * #MM-34437 adjusted times for licences generated through admin portal * Reverted test-only changes Co-authored-by: Martin Kraft <martin@upspin.org> Co-authored-by: Hossein <hahmadia@users.noreply.github.com> Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com> Co-authored-by: Jesús Espino <jespinog@gmail.com> Co-authored-by: Amy Blais <amy_blais@hotmail.com> Co-authored-by: Ben Cooke <benkcooke@gmail.com> Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in> Co-authored-by: Max Erenberg <max.erenberg@mattermost.com>
2021-06-17 08:07:34 -04:00
mock "github.com/stretchr/testify/mock"
)
// LicenseInterface is an autogenerated mock type for the LicenseInterface type
type LicenseInterface struct {
mock.Mock
}
Upgrade Go to 1.24.3 (#31220) * Upgrade Go to 1.24.3 Updates the following files: - server/.go-version: 1.23.9 → 1.24.3 - server/build/Dockerfile.buildenv: golang:1.23.9-bullseye → golang:1.24.3-bullseye - server/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3 - server/public/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3 Also fixes non-constant format string errors introduced by Go 1.24.3's stricter format string checking: - Added response() helper function in slashcommands/util.go for simple string responses - Removed unused responsef() function from slashcommands/util.go - Replaced responsef() with response() for translated strings that don't need formatting - Fixed fmt.Errorf and fmt.Fprintf calls to use proper format verbs instead of string concatenation - Updated marketplace buildURL to handle format strings conditionally 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Update generated mocks for Go 1.24.3 Regenerated mocks using mockery v2.53.4 to ensure compatibility with Go 1.24.3. This addresses mock generation failures that occurred with the Go upgrade. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Update to bookworm and fix non-existent sha Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com> * fix non-constant format string --------- Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Stavros Foteinopoulos <stafot@gmail.com>
2025-06-10 14:04:57 -04:00
// CanStartTrial provides a mock function with no fields
MM-34437 Preventing infinite trial requests (#17472) * MM-34434: Added 'is_trial' boolean to all trial license requests and to the License struct. * MM-34434: Generalized the concept of a license request. * MM-34434: Verifies JSON field of license instance is set. * MM-34434: Added missing client param. * MM-34434: Added some tests of the request trial API endpoint. * MM-34434: Removed comment. * fix broken test (#17348) * Add missing wrapped errors (#17339) * Improve document extraction and including a document extraction command (#17183) * Add extract documents content command * Adding the extraction command and making the pure go pdf library as secondary option * Improving the memory usage and docextractor interface * Enable content extraction by default in all the instances * Tiny improvement on archive indexing * Adding App interface generation and the opentracing layer * Fixing linter errors * Addressing PR review comments * Addressing PR review comments * Update en.json (#17356) Automatic Merge * adding new feature flag (#17308) Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> * Bump no_output_timeout to 2 hours (#17358) * log invalid username (#17345) Automatic Merge * MM-34434: Added missing client param. MM-34434: Added some tests of the request trial API endpoint. MM-34434: Removed comment. * MM-34434: Switched to a hard-coded true value. * MM-34434: Reverts test change. * MM-34434: Removes unnecessary field. * MM-34434: Tests that is_trial is hard-coded by TrialLicenseRequest. * MM-34434: Removed accidental commit. * MM-34434: Removes unnecessary is_trial key from JSON payload. * MM-34434: Reverts to old pointer receiver variable name. * MM-34434: Removes test. * #MM-34437 Initialized license service * ##MM-34437 Verified at all points if server is trial elligible * WIp * #MM-34437 removed unused commented code * MM-34437 make a log less severe * #MM-34437 generated einterface mocks * #MM-34437 added license on new file * #MM-34437 removed unused translation * #MM-34437 some refactoring * Update api4/license.go * Update api4/license.go * #MM-34437 made a variable name consistent * #MM-34437 Added mocks for lince validator * #M--34437 Added license validator test framework * #MM-34437 Renamed isTrial method to isTrialLicense to avoid conflict with newlya dded field * #M--34437 Allowed sales-sanctioned trials * #MM-34437 fixed trial license API tests * Added tests for add license API * #MM-34437 fixed ValidateLicense test * #MM-34437 Added util tests * #MM-34437 using NoError for checking no error * #MM-34437 using NoError for checking no error * Added dummy piblic key for testing * Fixed tests * #MM-34437 udpaetd trial license URL for testing * #MM-34437 adjusted times for licences generated through admin portal * Reverted test-only changes Co-authored-by: Martin Kraft <martin@upspin.org> Co-authored-by: Hossein <hahmadia@users.noreply.github.com> Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com> Co-authored-by: Jesús Espino <jespinog@gmail.com> Co-authored-by: Amy Blais <amy_blais@hotmail.com> Co-authored-by: Ben Cooke <benkcooke@gmail.com> Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in> Co-authored-by: Max Erenberg <max.erenberg@mattermost.com>
2021-06-17 08:07:34 -04:00
func (_m *LicenseInterface) CanStartTrial() (bool, error) {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for CanStartTrial")
}
MM-34437 Preventing infinite trial requests (#17472) * MM-34434: Added 'is_trial' boolean to all trial license requests and to the License struct. * MM-34434: Generalized the concept of a license request. * MM-34434: Verifies JSON field of license instance is set. * MM-34434: Added missing client param. * MM-34434: Added some tests of the request trial API endpoint. * MM-34434: Removed comment. * fix broken test (#17348) * Add missing wrapped errors (#17339) * Improve document extraction and including a document extraction command (#17183) * Add extract documents content command * Adding the extraction command and making the pure go pdf library as secondary option * Improving the memory usage and docextractor interface * Enable content extraction by default in all the instances * Tiny improvement on archive indexing * Adding App interface generation and the opentracing layer * Fixing linter errors * Addressing PR review comments * Addressing PR review comments * Update en.json (#17356) Automatic Merge * adding new feature flag (#17308) Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> * Bump no_output_timeout to 2 hours (#17358) * log invalid username (#17345) Automatic Merge * MM-34434: Added missing client param. MM-34434: Added some tests of the request trial API endpoint. MM-34434: Removed comment. * MM-34434: Switched to a hard-coded true value. * MM-34434: Reverts test change. * MM-34434: Removes unnecessary field. * MM-34434: Tests that is_trial is hard-coded by TrialLicenseRequest. * MM-34434: Removed accidental commit. * MM-34434: Removes unnecessary is_trial key from JSON payload. * MM-34434: Reverts to old pointer receiver variable name. * MM-34434: Removes test. * #MM-34437 Initialized license service * ##MM-34437 Verified at all points if server is trial elligible * WIp * #MM-34437 removed unused commented code * MM-34437 make a log less severe * #MM-34437 generated einterface mocks * #MM-34437 added license on new file * #MM-34437 removed unused translation * #MM-34437 some refactoring * Update api4/license.go * Update api4/license.go * #MM-34437 made a variable name consistent * #MM-34437 Added mocks for lince validator * #M--34437 Added license validator test framework * #MM-34437 Renamed isTrial method to isTrialLicense to avoid conflict with newlya dded field * #M--34437 Allowed sales-sanctioned trials * #MM-34437 fixed trial license API tests * Added tests for add license API * #MM-34437 fixed ValidateLicense test * #MM-34437 Added util tests * #MM-34437 using NoError for checking no error * #MM-34437 using NoError for checking no error * Added dummy piblic key for testing * Fixed tests * #MM-34437 udpaetd trial license URL for testing * #MM-34437 adjusted times for licences generated through admin portal * Reverted test-only changes Co-authored-by: Martin Kraft <martin@upspin.org> Co-authored-by: Hossein <hahmadia@users.noreply.github.com> Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com> Co-authored-by: Jesús Espino <jespinog@gmail.com> Co-authored-by: Amy Blais <amy_blais@hotmail.com> Co-authored-by: Ben Cooke <benkcooke@gmail.com> Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in> Co-authored-by: Max Erenberg <max.erenberg@mattermost.com>
2021-06-17 08:07:34 -04:00
var r0 bool
var r1 error
if rf, ok := ret.Get(0).(func() (bool, error)); ok {
return rf()
}
MM-34437 Preventing infinite trial requests (#17472) * MM-34434: Added 'is_trial' boolean to all trial license requests and to the License struct. * MM-34434: Generalized the concept of a license request. * MM-34434: Verifies JSON field of license instance is set. * MM-34434: Added missing client param. * MM-34434: Added some tests of the request trial API endpoint. * MM-34434: Removed comment. * fix broken test (#17348) * Add missing wrapped errors (#17339) * Improve document extraction and including a document extraction command (#17183) * Add extract documents content command * Adding the extraction command and making the pure go pdf library as secondary option * Improving the memory usage and docextractor interface * Enable content extraction by default in all the instances * Tiny improvement on archive indexing * Adding App interface generation and the opentracing layer * Fixing linter errors * Addressing PR review comments * Addressing PR review comments * Update en.json (#17356) Automatic Merge * adding new feature flag (#17308) Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> * Bump no_output_timeout to 2 hours (#17358) * log invalid username (#17345) Automatic Merge * MM-34434: Added missing client param. MM-34434: Added some tests of the request trial API endpoint. MM-34434: Removed comment. * MM-34434: Switched to a hard-coded true value. * MM-34434: Reverts test change. * MM-34434: Removes unnecessary field. * MM-34434: Tests that is_trial is hard-coded by TrialLicenseRequest. * MM-34434: Removed accidental commit. * MM-34434: Removes unnecessary is_trial key from JSON payload. * MM-34434: Reverts to old pointer receiver variable name. * MM-34434: Removes test. * #MM-34437 Initialized license service * ##MM-34437 Verified at all points if server is trial elligible * WIp * #MM-34437 removed unused commented code * MM-34437 make a log less severe * #MM-34437 generated einterface mocks * #MM-34437 added license on new file * #MM-34437 removed unused translation * #MM-34437 some refactoring * Update api4/license.go * Update api4/license.go * #MM-34437 made a variable name consistent * #MM-34437 Added mocks for lince validator * #M--34437 Added license validator test framework * #MM-34437 Renamed isTrial method to isTrialLicense to avoid conflict with newlya dded field * #M--34437 Allowed sales-sanctioned trials * #MM-34437 fixed trial license API tests * Added tests for add license API * #MM-34437 fixed ValidateLicense test * #MM-34437 Added util tests * #MM-34437 using NoError for checking no error * #MM-34437 using NoError for checking no error * Added dummy piblic key for testing * Fixed tests * #MM-34437 udpaetd trial license URL for testing * #MM-34437 adjusted times for licences generated through admin portal * Reverted test-only changes Co-authored-by: Martin Kraft <martin@upspin.org> Co-authored-by: Hossein <hahmadia@users.noreply.github.com> Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com> Co-authored-by: Jesús Espino <jespinog@gmail.com> Co-authored-by: Amy Blais <amy_blais@hotmail.com> Co-authored-by: Ben Cooke <benkcooke@gmail.com> Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in> Co-authored-by: Max Erenberg <max.erenberg@mattermost.com>
2021-06-17 08:07:34 -04:00
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(bool)
}
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
Upgrade Go to 1.24.3 (#31220) * Upgrade Go to 1.24.3 Updates the following files: - server/.go-version: 1.23.9 → 1.24.3 - server/build/Dockerfile.buildenv: golang:1.23.9-bullseye → golang:1.24.3-bullseye - server/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3 - server/public/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3 Also fixes non-constant format string errors introduced by Go 1.24.3's stricter format string checking: - Added response() helper function in slashcommands/util.go for simple string responses - Removed unused responsef() function from slashcommands/util.go - Replaced responsef() with response() for translated strings that don't need formatting - Fixed fmt.Errorf and fmt.Fprintf calls to use proper format verbs instead of string concatenation - Updated marketplace buildURL to handle format strings conditionally 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Update generated mocks for Go 1.24.3 Regenerated mocks using mockery v2.53.4 to ensure compatibility with Go 1.24.3. This addresses mock generation failures that occurred with the Go upgrade. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Update to bookworm and fix non-existent sha Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com> * fix non-constant format string --------- Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Stavros Foteinopoulos <stafot@gmail.com>
2025-06-10 14:04:57 -04:00
// GetPrevTrial provides a mock function with no fields
MM-34437 Preventing infinite trial requests (#17472) * MM-34434: Added 'is_trial' boolean to all trial license requests and to the License struct. * MM-34434: Generalized the concept of a license request. * MM-34434: Verifies JSON field of license instance is set. * MM-34434: Added missing client param. * MM-34434: Added some tests of the request trial API endpoint. * MM-34434: Removed comment. * fix broken test (#17348) * Add missing wrapped errors (#17339) * Improve document extraction and including a document extraction command (#17183) * Add extract documents content command * Adding the extraction command and making the pure go pdf library as secondary option * Improving the memory usage and docextractor interface * Enable content extraction by default in all the instances * Tiny improvement on archive indexing * Adding App interface generation and the opentracing layer * Fixing linter errors * Addressing PR review comments * Addressing PR review comments * Update en.json (#17356) Automatic Merge * adding new feature flag (#17308) Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> * Bump no_output_timeout to 2 hours (#17358) * log invalid username (#17345) Automatic Merge * MM-34434: Added missing client param. MM-34434: Added some tests of the request trial API endpoint. MM-34434: Removed comment. * MM-34434: Switched to a hard-coded true value. * MM-34434: Reverts test change. * MM-34434: Removes unnecessary field. * MM-34434: Tests that is_trial is hard-coded by TrialLicenseRequest. * MM-34434: Removed accidental commit. * MM-34434: Removes unnecessary is_trial key from JSON payload. * MM-34434: Reverts to old pointer receiver variable name. * MM-34434: Removes test. * #MM-34437 Initialized license service * ##MM-34437 Verified at all points if server is trial elligible * WIp * #MM-34437 removed unused commented code * MM-34437 make a log less severe * #MM-34437 generated einterface mocks * #MM-34437 added license on new file * #MM-34437 removed unused translation * #MM-34437 some refactoring * Update api4/license.go * Update api4/license.go * #MM-34437 made a variable name consistent * #MM-34437 Added mocks for lince validator * #M--34437 Added license validator test framework * #MM-34437 Renamed isTrial method to isTrialLicense to avoid conflict with newlya dded field * #M--34437 Allowed sales-sanctioned trials * #MM-34437 fixed trial license API tests * Added tests for add license API * #MM-34437 fixed ValidateLicense test * #MM-34437 Added util tests * #MM-34437 using NoError for checking no error * #MM-34437 using NoError for checking no error * Added dummy piblic key for testing * Fixed tests * #MM-34437 udpaetd trial license URL for testing * #MM-34437 adjusted times for licences generated through admin portal * Reverted test-only changes Co-authored-by: Martin Kraft <martin@upspin.org> Co-authored-by: Hossein <hahmadia@users.noreply.github.com> Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com> Co-authored-by: Jesús Espino <jespinog@gmail.com> Co-authored-by: Amy Blais <amy_blais@hotmail.com> Co-authored-by: Ben Cooke <benkcooke@gmail.com> Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in> Co-authored-by: Max Erenberg <max.erenberg@mattermost.com>
2021-06-17 08:07:34 -04:00
func (_m *LicenseInterface) GetPrevTrial() (*model.License, error) {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for GetPrevTrial")
}
MM-34437 Preventing infinite trial requests (#17472) * MM-34434: Added 'is_trial' boolean to all trial license requests and to the License struct. * MM-34434: Generalized the concept of a license request. * MM-34434: Verifies JSON field of license instance is set. * MM-34434: Added missing client param. * MM-34434: Added some tests of the request trial API endpoint. * MM-34434: Removed comment. * fix broken test (#17348) * Add missing wrapped errors (#17339) * Improve document extraction and including a document extraction command (#17183) * Add extract documents content command * Adding the extraction command and making the pure go pdf library as secondary option * Improving the memory usage and docextractor interface * Enable content extraction by default in all the instances * Tiny improvement on archive indexing * Adding App interface generation and the opentracing layer * Fixing linter errors * Addressing PR review comments * Addressing PR review comments * Update en.json (#17356) Automatic Merge * adding new feature flag (#17308) Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> * Bump no_output_timeout to 2 hours (#17358) * log invalid username (#17345) Automatic Merge * MM-34434: Added missing client param. MM-34434: Added some tests of the request trial API endpoint. MM-34434: Removed comment. * MM-34434: Switched to a hard-coded true value. * MM-34434: Reverts test change. * MM-34434: Removes unnecessary field. * MM-34434: Tests that is_trial is hard-coded by TrialLicenseRequest. * MM-34434: Removed accidental commit. * MM-34434: Removes unnecessary is_trial key from JSON payload. * MM-34434: Reverts to old pointer receiver variable name. * MM-34434: Removes test. * #MM-34437 Initialized license service * ##MM-34437 Verified at all points if server is trial elligible * WIp * #MM-34437 removed unused commented code * MM-34437 make a log less severe * #MM-34437 generated einterface mocks * #MM-34437 added license on new file * #MM-34437 removed unused translation * #MM-34437 some refactoring * Update api4/license.go * Update api4/license.go * #MM-34437 made a variable name consistent * #MM-34437 Added mocks for lince validator * #M--34437 Added license validator test framework * #MM-34437 Renamed isTrial method to isTrialLicense to avoid conflict with newlya dded field * #M--34437 Allowed sales-sanctioned trials * #MM-34437 fixed trial license API tests * Added tests for add license API * #MM-34437 fixed ValidateLicense test * #MM-34437 Added util tests * #MM-34437 using NoError for checking no error * #MM-34437 using NoError for checking no error * Added dummy piblic key for testing * Fixed tests * #MM-34437 udpaetd trial license URL for testing * #MM-34437 adjusted times for licences generated through admin portal * Reverted test-only changes Co-authored-by: Martin Kraft <martin@upspin.org> Co-authored-by: Hossein <hahmadia@users.noreply.github.com> Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com> Co-authored-by: Jesús Espino <jespinog@gmail.com> Co-authored-by: Amy Blais <amy_blais@hotmail.com> Co-authored-by: Ben Cooke <benkcooke@gmail.com> Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in> Co-authored-by: Max Erenberg <max.erenberg@mattermost.com>
2021-06-17 08:07:34 -04:00
var r0 *model.License
var r1 error
if rf, ok := ret.Get(0).(func() (*model.License, error)); ok {
return rf()
}
MM-34437 Preventing infinite trial requests (#17472) * MM-34434: Added 'is_trial' boolean to all trial license requests and to the License struct. * MM-34434: Generalized the concept of a license request. * MM-34434: Verifies JSON field of license instance is set. * MM-34434: Added missing client param. * MM-34434: Added some tests of the request trial API endpoint. * MM-34434: Removed comment. * fix broken test (#17348) * Add missing wrapped errors (#17339) * Improve document extraction and including a document extraction command (#17183) * Add extract documents content command * Adding the extraction command and making the pure go pdf library as secondary option * Improving the memory usage and docextractor interface * Enable content extraction by default in all the instances * Tiny improvement on archive indexing * Adding App interface generation and the opentracing layer * Fixing linter errors * Addressing PR review comments * Addressing PR review comments * Update en.json (#17356) Automatic Merge * adding new feature flag (#17308) Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> * Bump no_output_timeout to 2 hours (#17358) * log invalid username (#17345) Automatic Merge * MM-34434: Added missing client param. MM-34434: Added some tests of the request trial API endpoint. MM-34434: Removed comment. * MM-34434: Switched to a hard-coded true value. * MM-34434: Reverts test change. * MM-34434: Removes unnecessary field. * MM-34434: Tests that is_trial is hard-coded by TrialLicenseRequest. * MM-34434: Removed accidental commit. * MM-34434: Removes unnecessary is_trial key from JSON payload. * MM-34434: Reverts to old pointer receiver variable name. * MM-34434: Removes test. * #MM-34437 Initialized license service * ##MM-34437 Verified at all points if server is trial elligible * WIp * #MM-34437 removed unused commented code * MM-34437 make a log less severe * #MM-34437 generated einterface mocks * #MM-34437 added license on new file * #MM-34437 removed unused translation * #MM-34437 some refactoring * Update api4/license.go * Update api4/license.go * #MM-34437 made a variable name consistent * #MM-34437 Added mocks for lince validator * #M--34437 Added license validator test framework * #MM-34437 Renamed isTrial method to isTrialLicense to avoid conflict with newlya dded field * #M--34437 Allowed sales-sanctioned trials * #MM-34437 fixed trial license API tests * Added tests for add license API * #MM-34437 fixed ValidateLicense test * #MM-34437 Added util tests * #MM-34437 using NoError for checking no error * #MM-34437 using NoError for checking no error * Added dummy piblic key for testing * Fixed tests * #MM-34437 udpaetd trial license URL for testing * #MM-34437 adjusted times for licences generated through admin portal * Reverted test-only changes Co-authored-by: Martin Kraft <martin@upspin.org> Co-authored-by: Hossein <hahmadia@users.noreply.github.com> Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com> Co-authored-by: Jesús Espino <jespinog@gmail.com> Co-authored-by: Amy Blais <amy_blais@hotmail.com> Co-authored-by: Ben Cooke <benkcooke@gmail.com> Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local> Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in> Co-authored-by: Max Erenberg <max.erenberg@mattermost.com>
2021-06-17 08:07:34 -04:00
if rf, ok := ret.Get(0).(func() *model.License); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.License)
}
}
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewMattermostEntryLicense provides a mock function with given fields: serverId
func (_m *LicenseInterface) NewMattermostEntryLicense(serverId string) *model.License {
ret := _m.Called(serverId)
if len(ret) == 0 {
panic("no return value specified for NewMattermostEntryLicense")
}
var r0 *model.License
if rf, ok := ret.Get(0).(func(string) *model.License); ok {
r0 = rf(serverId)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*model.License)
}
}
return r0
}
// NewLicenseInterface creates a new instance of LicenseInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewLicenseInterface(t interface {
mock.TestingT
Cleanup(func())
}) *LicenseInterface {
mock := &LicenseInterface{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}