11#include <QtTest/QtTest>
17void SsuTest::initTestCase()
21void SsuTest::testCredentialsScope()
24 QCOMPARE(ssu.credentialsScope(QString(
"store")), QString(
"store"));
25 QCOMPARE(ssu.credentialsScope(QString(
"store-c-example")), QString(
"store"));
27 ssu.setDomain(QString(
"default"));
28 QCOMPARE(ssu.domain(), QString(
"default"));
30 QCOMPARE(ssu.credentialsScope(QString(
"store")), QString(
"store"));
31 QCOMPARE(ssu.credentialsScope(QString(
"apps")), QString(
"vendor"));
32 QCOMPARE(ssu.credentialsScope(QString(
"vendor")), QString(
"vendor"));
34 QCOMPARE(ssu.credentialsScope(QString(
"store"),
true), QString(
"store"));
35 QCOMPARE(ssu.credentialsScope(QString(
"adaptation"),
true), QString(
"vendor"));
36 QCOMPARE(ssu.credentialsScope(QString(
"oss"),
true), QString(
"vendor"));
39void SsuTest::testCredentialsScopeStoreAuthRepos()
41 ssu.setDomain(QString(
"example"));
42 QCOMPARE(ssu.domain(), QString(
"example"));
44 QCOMPARE(ssu.credentialsScope(QString(
"store")), QString(
"store"));
46 QCOMPARE(ssu.credentialsScope(QString(
"apps")), QString(
"store"));
47 QCOMPARE(ssu.credentialsScope(QString(
"vendor")), QString(
"vendor"));
49 QCOMPARE(ssu.credentialsScope(QString(
"store"),
true), QString(
"store"));
50 QCOMPARE(ssu.credentialsScope(QString(
"adaptation"),
true), QString(
"vendor"));
51 QCOMPARE(ssu.credentialsScope(QString(
"oss"),
true), QString(
"vendor"));
54void SsuTest::testCredentialsScopeSecureDomainAuth()
59 ssu.setDomain(
"example2");
60 QCOMPARE(ssu.domain(), QString(
"example2"));
62 QCOMPARE(ssu.credentialsScope(QString(
"store"),
false), QString(
"store"));
63 QCOMPARE(ssu.credentialsScope(QString(
"apps"),
false), QString(
"example2"));
64 QCOMPARE(ssu.credentialsScope(QString(
"vendor"),
false), QString(
"example2"));
67 QCOMPARE(ssu.credentialsScope(QString(
"adaptation"),
true), QString(
"example2"));
69 QCOMPARE(ssu.credentialsScope(QString(
"oss"),
true), QString(
"vendor"));