Skip to content

Commit

Permalink
fix: getter method name
Browse files Browse the repository at this point in the history
  • Loading branch information
nmussy committed Jun 21, 2024
1 parent a576189 commit 6754b0e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions packages/aws-cdk-lib/aws-codebuild/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,6 @@ abstract class ProjectBase extends Resource implements IProject {
*/
protected _connections: ec2.Connections | undefined;

/**
* Actual value will be determined for a Project
* using a getter depending on the effect of enableBatchBuilds
*/
public readonly isBatchBuildEnabled = false;

/**
* Access the Connections object.
* Will fail if this Project does not have a VPC set.
Expand All @@ -292,6 +286,14 @@ abstract class ProjectBase extends Resource implements IProject {
return this._connections;
}

/**
* Actual value will be determined for a Project
* using a getter depending on the effect of enableBatchBuilds
*/
public get isBatchBuildEnabled(): boolean {
return false;
}

public enableBatchBuilds(): BatchBuildConfig | undefined {
return undefined;
}
Expand Down Expand Up @@ -1220,7 +1222,7 @@ export class Project extends ProjectBase {
this.node.addValidation({ validate: () => this.validateProject() });
}

public get isBatchBuildsEnabled(): boolean {
public get isBatchBuildEnabled(): boolean {
return !!this._batchServiceRole;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-codebuild/test/codebuild.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2104,13 +2104,13 @@ test('enableBatchBuilds()', () => {
repo: 'testrepo',
}),
});
expect(project.isBatchBuildsEnabled).toBeFalsy();
expect(project.isBatchBuildEnabled).toBeFalsy();

const returnVal = project.enableBatchBuilds();
if (!returnVal?.role) {
throw new Error('Expecting return value with role');
}
expect(project.isBatchBuildsEnabled).toBeTruthy();
expect(project.isBatchBuildEnabled).toBeTruthy();

Template.fromStack(stack).hasResourceProperties('AWS::CodeBuild::Project', {
BuildBatchConfig: {
Expand Down

0 comments on commit 6754b0e

Please sign in to comment.