diff options
author | KAPIL SINGAL <ks220y@att.com> | 2021-01-22 11:49:51 -0500 |
---|---|---|
committer | Singal, Kapil (ks220y) <ks220y@att.com> | 2021-01-22 12:08:19 -0500 |
commit | adcd4f2bc695840e9ecbc05003bc52c675f22fec (patch) | |
tree | 5db58ce9b6b3e86977ca3c697ce3e8998523eb61 /ms/sdclistener | |
parent | dc8252f3cfa1ddd0c1c8c70513c16c738d840822 (diff) |
Renaming Files having BluePrint to have Blueprint
Replacing BluePrint with Blueprint throughout
Issue-ID: CCSDK-3098
Signed-off-by: KAPIL SINGAL <ks220y@att.com>
Change-Id: Ibee8bad07ae7d9287073db2d4f2f2cd730fa8b96
Diffstat (limited to 'ms/sdclistener')
-rw-r--r-- | ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/SdcListenerNotificationCallback.java | 4 | ||||
-rw-r--r-- | ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/handler/BlueprintProcesssorHandler.java (renamed from ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/handler/BluePrintProcesssorHandler.java) | 20 | ||||
-rw-r--r-- | ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/service/ListenerService.java | 4 | ||||
-rw-r--r-- | ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/service/ListenerServiceImpl.java | 20 | ||||
-rw-r--r-- | ms/sdclistener/application/src/test/java/org/onap/ccsdk/cds/sdclistener/handler/BlueprintProcessorHandlerTest.java (renamed from ms/sdclistener/application/src/test/java/org/onap/ccsdk/cds/sdclistener/handler/BluePrintProcessorHandlerTest.java) | 32 | ||||
-rw-r--r-- | ms/sdclistener/application/src/test/java/org/onap/ccsdk/cds/sdclistener/service/ListenerServiceImplTest.java | 12 |
6 files changed, 46 insertions, 46 deletions
diff --git a/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/SdcListenerNotificationCallback.java b/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/SdcListenerNotificationCallback.java index b8868325a..45fb36736 100644 --- a/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/SdcListenerNotificationCallback.java +++ b/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/SdcListenerNotificationCallback.java @@ -122,13 +122,13 @@ public class SdcListenerNotificationCallback implements INotificationCallback { final String archivePath = cbaArchivePath.toString(); // Extract CBA archive from CSAR package and store it into local disk - csarFiles.forEach(file -> listenerService.extractBluePrint(file.getAbsolutePath(), archivePath)); + csarFiles.forEach(file -> listenerService.extractBlueprint(file.getAbsolutePath(), archivePath)); csarFiles.forEach(file -> FileUtil.deleteFile(file, csarArchivePath.toString())); } else { LOGGER.error("Could not able to read CSAR files from this location {}", csarArchivePath); } - listenerService.saveBluePrintToCdsDatabase(cbaArchivePath, sdcListenerDto.getManagedChannelForGrpc()); + listenerService.saveBlueprintToCdsDatabase(cbaArchivePath, sdcListenerDto.getManagedChannelForGrpc()); } } diff --git a/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/handler/BluePrintProcesssorHandler.java b/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/handler/BlueprintProcesssorHandler.java index b80dd260d..41475cd6b 100644 --- a/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/handler/BluePrintProcesssorHandler.java +++ b/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/handler/BlueprintProcesssorHandler.java @@ -18,10 +18,10 @@ package org.onap.ccsdk.cds.sdclistener.handler; import io.grpc.ManagedChannel; import org.onap.ccsdk.cds.controllerblueprints.common.api.Status; -import org.onap.ccsdk.cds.controllerblueprints.management.api.BluePrintManagementOutput; -import org.onap.ccsdk.cds.controllerblueprints.management.api.BluePrintManagementServiceGrpc; -import org.onap.ccsdk.cds.controllerblueprints.management.api.BluePrintManagementServiceGrpc.BluePrintManagementServiceBlockingStub; -import org.onap.ccsdk.cds.controllerblueprints.management.api.BluePrintUploadInput; +import org.onap.ccsdk.cds.controllerblueprints.management.api.BlueprintManagementOutput; +import org.onap.ccsdk.cds.controllerblueprints.management.api.BlueprintManagementServiceGrpc; +import org.onap.ccsdk.cds.controllerblueprints.management.api.BlueprintManagementServiceGrpc.BlueprintManagementServiceBlockingStub; +import org.onap.ccsdk.cds.controllerblueprints.management.api.BlueprintUploadInput; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.context.properties.ConfigurationProperties; @@ -29,29 +29,29 @@ import org.springframework.stereotype.Component; @ConfigurationProperties("listenerservice") @Component -public class BluePrintProcesssorHandler implements AutoCloseable { +public class BlueprintProcesssorHandler implements AutoCloseable { - private static final Logger LOGGER = LoggerFactory.getLogger(BluePrintProcesssorHandler.class); + private static final Logger LOGGER = LoggerFactory.getLogger(BlueprintProcesssorHandler.class); private ManagedChannel channel; /** * Sending CBA archive to CDS backend to store into its Database. * - * @param request BluePrintManagementInput object holds CBA archive, its version and blueprints. + * @param request BlueprintManagementInput object holds CBA archive, its version and blueprints. * @param managedChannel - ManagedChannel object helps to access the server or application end point. * * @return A response object */ - public Status sendRequest(BluePrintUploadInput request, ManagedChannel managedChannel) { + public Status sendRequest(BlueprintUploadInput request, ManagedChannel managedChannel) { LOGGER.info("Sending request to blueprint processor"); this.channel = managedChannel; - final BluePrintManagementServiceBlockingStub syncStub = BluePrintManagementServiceGrpc.newBlockingStub(channel); + final BlueprintManagementServiceBlockingStub syncStub = BlueprintManagementServiceGrpc.newBlockingStub(channel); // Send the request to CDS backend. - final BluePrintManagementOutput response = syncStub.uploadBlueprint(request); + final BlueprintManagementOutput response = syncStub.uploadBlueprint(request); return response.getStatus(); } diff --git a/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/service/ListenerService.java b/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/service/ListenerService.java index 5fa3fb327..231054f06 100644 --- a/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/service/ListenerService.java +++ b/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/service/ListenerService.java @@ -29,7 +29,7 @@ public interface ListenerService { * @param csarArchivePath The path where CSAR archive is stored. * @param cbaArchivePath The destination path where CBA will be stored. */ - void extractBluePrint(String csarArchivePath, String cbaArchivePath); + void extractBlueprint(String csarArchivePath, String cbaArchivePath); /** * Store the Zip file into CDS database. @@ -37,7 +37,7 @@ public interface ListenerService { * @param path path where zip file exists. * @param managedChannel To access the blueprint processor application end point */ - void saveBluePrintToCdsDatabase(Path path, ManagedChannel managedChannel); + void saveBlueprintToCdsDatabase(Path path, ManagedChannel managedChannel); /** * Extract and store the csar package to local disk. diff --git a/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/service/ListenerServiceImpl.java b/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/service/ListenerServiceImpl.java index ee27a9475..1aebd74b8 100644 --- a/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/service/ListenerServiceImpl.java +++ b/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/service/ListenerServiceImpl.java @@ -23,12 +23,12 @@ import org.apache.commons.io.IOUtils; import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers; import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader; import org.onap.ccsdk.cds.controllerblueprints.common.api.Status; -import org.onap.ccsdk.cds.controllerblueprints.management.api.BluePrintUploadInput; +import org.onap.ccsdk.cds.controllerblueprints.management.api.BlueprintUploadInput; import org.onap.ccsdk.cds.controllerblueprints.management.api.FileChunk; import org.onap.ccsdk.cds.controllerblueprints.management.api.UploadAction; import org.onap.ccsdk.cds.sdclistener.client.SdcListenerAuthClientInterceptor; import org.onap.ccsdk.cds.sdclistener.dto.SdcListenerDto; -import org.onap.ccsdk.cds.sdclistener.handler.BluePrintProcesssorHandler; +import org.onap.ccsdk.cds.sdclistener.handler.BlueprintProcesssorHandler; import org.onap.ccsdk.cds.sdclistener.status.SdcListenerStatus; import org.onap.ccsdk.cds.sdclistener.util.FileUtil; import org.onap.sdc.api.results.IDistributionClientDownloadResult; @@ -64,7 +64,7 @@ import static org.onap.sdc.utils.DistributionStatusEnum.COMPONENT_DONE_OK; public class ListenerServiceImpl implements ListenerService { @Autowired - private BluePrintProcesssorHandler bluePrintProcesssorHandler; + private BlueprintProcesssorHandler bluePrintProcesssorHandler; @Autowired private SdcListenerAuthClientInterceptor sdcListenerAuthClientInterceptor; @@ -87,7 +87,7 @@ public class ListenerServiceImpl implements ListenerService { private static final Logger LOGGER = LoggerFactory.getLogger(ListenerServiceImpl.class); @Override - public void extractBluePrint(String csarArchivePath, String cbaArchivePath) { + public void extractBlueprint(String csarArchivePath, String cbaArchivePath) { int validPathCount = 0; final String distributionId = getDistributionId(); final String artifactUrl = getArtifactUrl(); @@ -101,7 +101,7 @@ public class ListenerServiceImpl implements ListenerService { validPathCount++; final String cbaArchiveName = Paths.get(fileName).getFileName().toString(); LOGGER.info("Storing the CBA archive {}", cbaArchiveName); - storeBluePrint(zipFile, cbaArchiveName, cbaStorageDir, entry); + storeBlueprint(zipFile, cbaArchiveName, cbaStorageDir, entry); } } @@ -121,7 +121,7 @@ public class ListenerServiceImpl implements ListenerService { } } - private void storeBluePrint(ZipFile zipFile, String fileName, Path cbaArchivePath, ZipEntry entry) { + private void storeBlueprint(ZipFile zipFile, String fileName, Path cbaArchivePath, ZipEntry entry) { Path targetLocation = cbaArchivePath.resolve(fileName); LOGGER.info("The target location for zip file is {}", targetLocation); File targetZipFile = new File(targetLocation.toString()); @@ -144,7 +144,7 @@ public class ListenerServiceImpl implements ListenerService { } @Override - public void saveBluePrintToCdsDatabase(Path cbaArchivePath, ManagedChannel channel) { + public void saveBlueprintToCdsDatabase(Path cbaArchivePath, ManagedChannel channel) { List<File> zipFiles = FileUtil.getFilesFromDisk(cbaArchivePath); if (!zipFiles.isEmpty()) { prepareRequestForCdsBackend(zipFiles, channel, cbaArchivePath.toString()); @@ -193,7 +193,7 @@ public class ListenerServiceImpl implements ListenerService { files.forEach(zipFile -> { try { - final BluePrintUploadInput request = generateBluePrintUploadInputBuilder(zipFile, path); + final BlueprintUploadInput request = generateBlueprintUploadInputBuilder(zipFile, path); // Send request to CDS Backend. final Status responseStatus = bluePrintProcesssorHandler.sendRequest(request, managedChannel); @@ -219,11 +219,11 @@ public class ListenerServiceImpl implements ListenerService { }); } - private BluePrintUploadInput generateBluePrintUploadInputBuilder(File file, String path) throws IOException { + private BlueprintUploadInput generateBlueprintUploadInputBuilder(File file, String path) throws IOException { byte[] bytes = FileUtils.readFileToByteArray(file); FileChunk fileChunk = FileChunk.newBuilder().setChunk(ByteString.copyFrom(bytes)).build(); FileUtil.deleteFile(file, path); - return BluePrintUploadInput.newBuilder() + return BlueprintUploadInput.newBuilder() .setCommonHeader(CommonHeader.newBuilder().setRequestId(UUID.randomUUID().toString()) .setSubRequestId(UUID.randomUUID().toString()).setOriginatorId("SDC-LISTENER").build()) .setActionIdentifiers( diff --git a/ms/sdclistener/application/src/test/java/org/onap/ccsdk/cds/sdclistener/handler/BluePrintProcessorHandlerTest.java b/ms/sdclistener/application/src/test/java/org/onap/ccsdk/cds/sdclistener/handler/BlueprintProcessorHandlerTest.java index 7cde45d9e..b48a98e15 100644 --- a/ms/sdclistener/application/src/test/java/org/onap/ccsdk/cds/sdclistener/handler/BluePrintProcessorHandlerTest.java +++ b/ms/sdclistener/application/src/test/java/org/onap/ccsdk/cds/sdclistener/handler/BlueprintProcessorHandlerTest.java @@ -30,9 +30,9 @@ import org.junit.runner.RunWith; import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers; import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader; import org.onap.ccsdk.cds.controllerblueprints.common.api.Status; -import org.onap.ccsdk.cds.controllerblueprints.management.api.BluePrintManagementOutput; -import org.onap.ccsdk.cds.controllerblueprints.management.api.BluePrintManagementServiceGrpc.BluePrintManagementServiceImplBase; -import org.onap.ccsdk.cds.controllerblueprints.management.api.BluePrintUploadInput; +import org.onap.ccsdk.cds.controllerblueprints.management.api.BlueprintManagementOutput; +import org.onap.ccsdk.cds.controllerblueprints.management.api.BlueprintManagementServiceGrpc.BlueprintManagementServiceImplBase; +import org.onap.ccsdk.cds.controllerblueprints.management.api.BlueprintUploadInput; import org.onap.ccsdk.cds.controllerblueprints.management.api.FileChunk; import org.onap.ccsdk.cds.controllerblueprints.management.api.UploadAction; import org.onap.ccsdk.cds.sdclistener.client.SdcListenerAuthClientInterceptor; @@ -50,12 +50,12 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @RunWith(SpringRunner.class) -@EnableConfigurationProperties({BluePrintProcesssorHandler.class, SdcListenerAuthClientInterceptor.class}) -@SpringBootTest(classes = {BluePrintProcessorHandlerTest.class}) -public class BluePrintProcessorHandlerTest { +@EnableConfigurationProperties({BlueprintProcesssorHandler.class, SdcListenerAuthClientInterceptor.class}) +@SpringBootTest(classes = {BlueprintProcessorHandlerTest.class}) +public class BlueprintProcessorHandlerTest { @Autowired - private BluePrintProcesssorHandler bluePrintProcesssorHandler; + private BlueprintProcesssorHandler bluePrintProcesssorHandler; @Autowired private SdcListenerAuthClientInterceptor sdcListenerAuthClientInterceptor; @@ -70,11 +70,11 @@ public class BluePrintProcessorHandlerTest { @Before public void setUp() throws IOException { - final BluePrintManagementServiceImplBase serviceImplBase = new BluePrintManagementServiceImplBase() { + final BlueprintManagementServiceImplBase serviceImplBase = new BlueprintManagementServiceImplBase() { @Override - public void uploadBlueprint(BluePrintUploadInput request, - StreamObserver<BluePrintManagementOutput> responseObserver) { - responseObserver.onNext(getBluePrintManagementOutput()); + public void uploadBlueprint(BlueprintUploadInput request, + StreamObserver<BlueprintManagementOutput> responseObserver) { + responseObserver.onNext(getBlueprintManagementOutput()); responseObserver.onCompleted(); } }; @@ -93,7 +93,7 @@ public class BluePrintProcessorHandlerTest { @Test public void testApplicationEndPointSucess() throws IOException { // Arrange - BluePrintUploadInput request = generateRequest(); + BlueprintUploadInput request = generateRequest(); // Act Status output = bluePrintProcesssorHandler.sendRequest(request, channel); @@ -103,12 +103,12 @@ public class BluePrintProcessorHandlerTest { assertTrue(output.getMessage().contains(SUCCESS_MSG)); } - private BluePrintUploadInput generateRequest() throws IOException { + private BlueprintUploadInput generateRequest() throws IOException { File file = Paths.get(CBA_ARCHIVE).toFile(); byte[] bytes = FileUtils.readFileToByteArray(file); FileChunk fileChunk = FileChunk.newBuilder().setChunk(ByteString.copyFrom(bytes)).build(); - return BluePrintUploadInput.newBuilder() + return BlueprintUploadInput.newBuilder() .setCommonHeader(CommonHeader.newBuilder().setRequestId(UUID.randomUUID().toString()) .setSubRequestId(UUID.randomUUID().toString()).setOriginatorId("SDC-LISTENER").build()) .setActionIdentifiers( @@ -116,8 +116,8 @@ public class BluePrintProcessorHandlerTest { .setFileChunk(fileChunk).build(); } - private BluePrintManagementOutput getBluePrintManagementOutput() { - return BluePrintManagementOutput.newBuilder() + private BlueprintManagementOutput getBlueprintManagementOutput() { + return BlueprintManagementOutput.newBuilder() .setStatus(Status.newBuilder().setMessage(SUCCESS_MSG).setCode(200).build()).build(); } diff --git a/ms/sdclistener/application/src/test/java/org/onap/ccsdk/cds/sdclistener/service/ListenerServiceImplTest.java b/ms/sdclistener/application/src/test/java/org/onap/ccsdk/cds/sdclistener/service/ListenerServiceImplTest.java index 4179ccab0..2e55c8e25 100644 --- a/ms/sdclistener/application/src/test/java/org/onap/ccsdk/cds/sdclistener/service/ListenerServiceImplTest.java +++ b/ms/sdclistener/application/src/test/java/org/onap/ccsdk/cds/sdclistener/service/ListenerServiceImplTest.java @@ -29,7 +29,7 @@ import org.mockito.junit.MockitoRule; import org.onap.ccsdk.cds.sdclistener.SdcListenerConfiguration; import org.onap.ccsdk.cds.sdclistener.client.SdcListenerAuthClientInterceptor; import org.onap.ccsdk.cds.sdclistener.dto.SdcListenerDto; -import org.onap.ccsdk.cds.sdclistener.handler.BluePrintProcesssorHandler; +import org.onap.ccsdk.cds.sdclistener.handler.BlueprintProcesssorHandler; import org.onap.ccsdk.cds.sdclistener.status.SdcListenerStatus; import org.onap.sdc.api.results.IDistributionClientDownloadResult; import org.onap.sdc.impl.mock.DistributionClientResultStubImpl; @@ -50,7 +50,7 @@ import static org.onap.ccsdk.cds.sdclistener.status.SdcListenerStatus.Notificati import static org.onap.sdc.utils.DistributionStatusEnum.COMPONENT_DONE_OK; @RunWith(SpringRunner.class) -@EnableConfigurationProperties({SdcListenerAuthClientInterceptor.class, BluePrintProcesssorHandler.class, +@EnableConfigurationProperties({SdcListenerAuthClientInterceptor.class, BlueprintProcesssorHandler.class, SdcListenerDto.class, ListenerServiceImpl.class, SdcListenerStatus.class, SdcListenerConfiguration.class}) @SpringBootTest(classes = {ListenerServiceImplTest.class}) public class ListenerServiceImplTest { @@ -90,9 +90,9 @@ public class ListenerServiceImplTest { } @Test - public void extractBluePrintSuccessfully() throws IOException { + public void extractBlueprintSuccessfully() throws IOException { // Act - listenerService.extractBluePrint(CSAR_SAMPLE, tempDirectoryPath.toString()); + listenerService.extractBlueprint(CSAR_SAMPLE, tempDirectoryPath.toString()); // Verify. String result = checkFileExists(tempDirectoryPath); @@ -100,7 +100,7 @@ public class ListenerServiceImplTest { } @Test - public void extractBluePrintFailure() { + public void extractBlueprintFailure() { // Arrange Mockito.when(listenerDto.getDistributionId()).thenReturn(DISTRIBUTION_ID); Mockito.when(listenerDto.getArtifactUrl()).thenReturn(URL); @@ -108,7 +108,7 @@ public class ListenerServiceImplTest { SDC_LISTENER_COMPONENT); // Act - listenerService.extractBluePrint(WRONG_CSAR_SAMPLE, tempDirectoryPath.toString()); + listenerService.extractBlueprint(WRONG_CSAR_SAMPLE, tempDirectoryPath.toString()); // Verify Mockito.verify(status).sendResponseBackToSdc(DISTRIBUTION_ID, COMPONENT_DONE_OK, null, URL, |