mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-20 14:10:44 +00:00
Switch tests (back) to use mock authentication
This commit is contained in:
@ -50,7 +50,25 @@ public class SampleCli
|
||||
{
|
||||
try
|
||||
{
|
||||
QInstance qInstance = SampleMetaDataProvider.defineInstance();
|
||||
QInstance qInstance = SampleMetaDataProvider.defineInstance();
|
||||
return (run(qInstance, args));
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
**
|
||||
***************************************************************************/
|
||||
int run(QInstance qInstance, String[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
QPicoCliImplementation qPicoCliImplementation = new QPicoCliImplementation(qInstance);
|
||||
|
||||
return (qPicoCliImplementation.runCli("my-sample-cli", args));
|
||||
|
@ -144,7 +144,6 @@ public class SampleMetaDataProvider extends AbstractQQQApplication
|
||||
{
|
||||
QInstance qInstance = new QInstance();
|
||||
|
||||
// qInstance.setAuthentication(defineAuthentication());
|
||||
qInstance.addBackend(defineRdbmsBackend());
|
||||
qInstance.addBackend(defineMemoryBackend());
|
||||
qInstance.addBackend(defineFilesystemBackend());
|
||||
@ -175,6 +174,18 @@ public class SampleMetaDataProvider extends AbstractQQQApplication
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
** for tests, define the same instance as above, but use mock authentication.
|
||||
***************************************************************************/
|
||||
public static QInstance defineTestInstance() throws QException
|
||||
{
|
||||
QInstance qInstance = defineInstance();
|
||||
qInstance.setAuthentication(defineAuthentication());
|
||||
return qInstance;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
**
|
||||
***************************************************************************/
|
||||
|
Reference in New Issue
Block a user