mirror of
https://gitlab.com/spaceti-app/integrations/acs/colnod-connector.git
synced 2026-07-12 14:30:50 +02:00
Another analyze changes
This commit is contained in:
parent
7b21c1f9a7
commit
e0e0d5be7e
@ -33,7 +33,7 @@ void Entity::setLastUpdate(quint64 lastUpdate) {
|
|||||||
this->lastUpdate = lastUpdate;
|
this->lastUpdate = lastUpdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Entity::idToStringWithoutBraces()
|
QString Entity::idToStringWithoutBraces() const
|
||||||
{
|
{
|
||||||
const qint8 lengthOfUuid = 36;
|
const qint8 lengthOfUuid = 36;
|
||||||
return id.toString().mid(1, lengthOfUuid);
|
return id.toString().mid(1, lengthOfUuid);
|
||||||
@ -49,7 +49,7 @@ void Entity::fromJSON(const QJsonObject &json) {
|
|||||||
QJsonObject Entity::toJSON() const {
|
QJsonObject Entity::toJSON() const {
|
||||||
QJsonObject json;
|
QJsonObject json;
|
||||||
|
|
||||||
json.value("id") = id.toString().mid(1,36);
|
json.value("id") = this->idToStringWithoutBraces();
|
||||||
json.value("name") = name;
|
json.value("name") = name;
|
||||||
json.value("description") = description;
|
json.value("description") = description;
|
||||||
json.value("lastUpdate") = lastUpdate;
|
json.value("lastUpdate") = lastUpdate;
|
||||||
|
|||||||
@ -22,7 +22,7 @@ public:
|
|||||||
quint64 getLastUpdate() const;
|
quint64 getLastUpdate() const;
|
||||||
void setLastUpdate(quint64 lastUpdate);
|
void setLastUpdate(quint64 lastUpdate);
|
||||||
|
|
||||||
QString idToStringWithoutBraces();
|
QString idToStringWithoutBraces() const;
|
||||||
|
|
||||||
virtual void fromJSON(const QJsonObject &json);
|
virtual void fromJSON(const QJsonObject &json);
|
||||||
virtual QJsonObject toJSON() const;
|
virtual QJsonObject toJSON() const;
|
||||||
|
|||||||
@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
|
|
||||||
Subject::Subject(QString name)
|
Subject::Subject(const QString& name)
|
||||||
{
|
{
|
||||||
setName(std::move(name));
|
setName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Subject::getEmail() const {
|
QString Subject::getEmail() const {
|
||||||
|
|||||||
@ -12,7 +12,7 @@ class Subject : public Entity {
|
|||||||
public:
|
public:
|
||||||
using Entity::Entity;
|
using Entity::Entity;
|
||||||
Subject() = default;
|
Subject() = default;
|
||||||
Subject(QString name);
|
Subject(const QString& name);
|
||||||
|
|
||||||
QString getEmail() const;
|
QString getEmail() const;
|
||||||
|
|
||||||
|
|||||||
@ -3,11 +3,11 @@
|
|||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
Token::Token(QString name, QString tokenData, QString decription)
|
Token::Token(const QString& name, QString tokenData, const QString& decription)
|
||||||
{
|
{
|
||||||
this->setName(std::move(name));
|
this->setName(name);
|
||||||
this->tokenData = std::move(tokenData);
|
this->tokenData = std::move(tokenData);
|
||||||
this->setDescription(std::move(decription));
|
this->setDescription(decription);
|
||||||
this->setId(QUuid::createUuid());
|
this->setId(QUuid::createUuid());
|
||||||
this->tokenType = "Token";
|
this->tokenType = "Token";
|
||||||
this->tokenBits = 32;
|
this->tokenBits = 32;
|
||||||
@ -17,9 +17,9 @@ Token::Token(QString name, QString tokenData, QString decription)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Token::Token(QString name)
|
Token::Token(const QString& name)
|
||||||
{
|
{
|
||||||
this->setName(std::move(name));
|
this->setName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -10,8 +10,8 @@ public:
|
|||||||
// using Entity::Entity;
|
// using Entity::Entity;
|
||||||
|
|
||||||
Token() = default;
|
Token() = default;
|
||||||
Token(QString name, QString tokenData, QString decription = "mobile");
|
Token(const QString& name, QString tokenData, const QString& decription = "mobile");
|
||||||
Token(QString name);
|
Token(const QString& name);
|
||||||
|
|
||||||
friend bool operator<(const Token &rToken, const Token &lToken){
|
friend bool operator<(const Token &rToken, const Token &lToken){
|
||||||
return rToken.getLastModified() < lToken.getLastUpdate();
|
return rToken.getLastModified() < lToken.getLastUpdate();
|
||||||
|
|||||||
@ -104,8 +104,6 @@ void ComplexTest::complexTest()
|
|||||||
QVERIFY(doc2.object()["items"].toArray().contains("582c982d-6fd7-4856-8548-7ce542791c7a"));
|
QVERIFY(doc2.object()["items"].toArray().contains("582c982d-6fd7-4856-8548-7ce542791c7a"));
|
||||||
// CHECK_DELETED_TOKENS_END
|
// CHECK_DELETED_TOKENS_END
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// LAST_TESTS (for sure)
|
// LAST_TESTS (for sure)
|
||||||
QCOMPARE(loginSpy.count(), 1); // Checking multiple calls
|
QCOMPARE(loginSpy.count(), 1); // Checking multiple calls
|
||||||
QCOMPARE(loginRespSpy.count(), 1);
|
QCOMPARE(loginRespSpy.count(), 1);
|
||||||
@ -113,7 +111,6 @@ void ComplexTest::complexTest()
|
|||||||
QCOMPARE(getNumOfTokens(), numOfTokens);
|
QCOMPARE(getNumOfTokens(), numOfTokens);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ComplexTest::fullSync()
|
void ComplexTest::fullSync()
|
||||||
{
|
{
|
||||||
api->prepareDatabase();
|
api->prepareDatabase();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user