Skip to content

Commit

Permalink
snapshotEndpointUrl -> mavenSnapshotEndpointUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 committed Apr 18, 2023
1 parent bfe92a0 commit 7c89376
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions lib/config/Configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import os from "node:os";
* @alias @ui5/project/config/Configuration
*/
class Configuration {
#snapshotEndpointUrl;
#mavenSnapshotEndpointUrl;

/**
* @param {object} configuration
* @param {string} [configuration.snapshotEndpointUrl]
* @param {string} [configuration.mavenSnapshotEndpointUrl]
*/
constructor({snapshotEndpointUrl}) {
this.#snapshotEndpointUrl = snapshotEndpointUrl;
constructor({mavenSnapshotEndpointUrl}) {
this.#mavenSnapshotEndpointUrl = mavenSnapshotEndpointUrl;
}

/**
Expand All @@ -27,8 +27,8 @@ class Configuration {
* @public
* @returns {string}
*/
getSnapshotEndpointUrl() {
return this.#snapshotEndpointUrl;
getMavenSnapshotEndpointUrl() {
return this.#mavenSnapshotEndpointUrl;
}

/**
Expand All @@ -37,7 +37,7 @@ class Configuration {
*/
toJSON() {
return {
snapshotEndpointUrl: this.#snapshotEndpointUrl,
mavenSnapshotEndpointUrl: this.#mavenSnapshotEndpointUrl,
};
}

Expand Down
2 changes: 1 addition & 1 deletion lib/ui5Framework/Sapui5MavenSnapshotResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class Sapui5MavenSnapshotResolver extends AbstractResolver {
if (ok) {
log.info(`Using Maven snapshot endpoint URL resolved from Maven configuration file: ${url}`);
log.info(`Consider persisting this choice by executing the following command: ` +
`ui5 config set snapshotEndpointUrl ${url}`);
`ui5 config set mavenSnapshotEndpointUrl ${url}`);
} else {
log.verbose(`User rejected usage of the resolved URL`);
url = null;
Expand Down
2 changes: 1 addition & 1 deletion lib/ui5Framework/maven/Installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Installer extends AbstractInstaller {
reject(new Error(
`Installer: Missing or empty Maven repository URL for snapshot consumption. ` +
`Please configure the correct URL using the following command: ` +
`ui5 config set snapshotEndpointUrl https://registry.corp/vendor/build-snapshots/`));
`ui5 config set mavenSnapshotEndpointUrl https://registry.corp/vendor/build-snapshots/`));
}

resolve(new Registry({endpointUrl: snapshotEndpointUrl}));
Expand Down
14 changes: 7 additions & 7 deletions test/lib/config/Configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test.serial("Build configuration with defaults", (t) => {
const config = new Configuration({});

t.deepEqual(config.toJSON(), {
snapshotEndpointUrl: undefined
mavenSnapshotEndpointUrl: undefined
});
});

Expand All @@ -43,7 +43,7 @@ test.serial("Overwrite defaults defaults", (t) => {
const {Configuration} = t.context;

const params = {
snapshotEndpointUrl: "https://snapshot.url"
mavenSnapshotEndpointUrl: "https://snapshot.url"
};

const config = new Configuration(params);
Expand All @@ -55,12 +55,12 @@ test.serial("Check getters", (t) => {
const {Configuration} = t.context;

const params = {
snapshotEndpointUrl: "https://snapshot.url"
mavenSnapshotEndpointUrl: "https://snapshot.url"
};

const config = new Configuration(params);

t.is(config.getSnapshotEndpointUrl(), params.snapshotEndpointUrl);
t.is(config.getMavenSnapshotEndpointUrl(), params.mavenSnapshotEndpointUrl);
});


Expand All @@ -69,7 +69,7 @@ test.serial("fromFile", async (t) => {
const {promisifyStub, sinon} = t.context;

const ui5rcContents = {
snapshotEndpointUrl: "https://snapshot.url"
mavenSnapshotEndpointUrl: "https://snapshot.url"
};
const responseStub = sinon.stub().resolves(JSON.stringify(ui5rcContents));
promisifyStub.callsFake(() => responseStub);
Expand All @@ -89,7 +89,7 @@ test.serial("fromFile: configuration file not found- fallback to default config"
const config = await fromFile("/non-existing/path/.ui5rc");

t.is(config instanceof Configuration, true, "Created a default configuration");
t.is(config.getSnapshotEndpointUrl(), undefined, "Dafault settings");
t.is(config.getMavenSnapshotEndpointUrl(), undefined, "Dafault settings");
});

test.serial("fromFile: throws", async (t) => {
Expand All @@ -111,7 +111,7 @@ test.serial("toFile", async (t) => {
const writeStub = sinon.stub().resolves();
promisifyStub.callsFake(() => writeStub);

const config = new Configuration({snapshotEndpointUrl: "https://registry.corp/vendor/build-snapshots/"});
const config = new Configuration({mavenSnapshotEndpointUrl: "https://registry.corp/vendor/build-snapshots/"});
await toFile(config, "/path/to/save/.ui5rc");

t.deepEqual(
Expand Down
2 changes: 1 addition & 1 deletion test/lib/ui5framework/Sapui5MavenSnapshotResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ test.serial("_resolveSnapshotEndpointUrlFromMaven", async (t) => {
"Using Maven snapshot endpoint URL resolved from Maven configuration file: /build-snapshots/");
t.is(loggerInfo.getCall(1).args[0],
"Consider persisting this choice by executing the following command: " +
"ui5 config set snapshotEndpointUrl /build-snapshots/");
"ui5 config set mavenSnapshotEndpointUrl /build-snapshots/");
});

test.serial("_resolveSnapshotEndpointUrlFromMaven fails", async (t) => {
Expand Down

0 comments on commit 7c89376

Please sign in to comment.