@Test public void getInfo() throws IOException { DateTime blobCreated = DateTime.now(); String expected = String.format("{\"Version\":\"v1.0.0\",\"Time\":\"%s\"}", blobCreated.toString()); when(dataAccess.findAsset(any(), any(), any())).thenReturn(asset1); when(asset1.blobCreated()).thenReturn(blobCreated); GolangAttributes goAttributes = new GolangAttributes(); goAttributes.setModule("module"); goAttributes.setVersion("v1.0.0"); Content content = underTest.getInfo(MODULE_INFO, goAttributes); String response = CharStreams.toString(new InputStreamReader(content.openInputStream(), Charsets.UTF_8)); assertThat(response, is(equalTo(expected))); }
@Override @Nullable @Transactional public Content getInfo(final String path, final GolangAttributes golangAttributes) { checkNotNull(path); checkNotNull(golangAttributes); String newPath = getZipAssetPathFromInfoPath(path); StreamPayload streamPayload = extractInfoFromZip(golangAttributes, newPath); if (streamPayload == null) { return null; } return new Content(streamPayload); }
GolangHostedFacetImpl extends FacetSupport implements GolangHostedFacet { @Override @Nullable @Transactional public Content getInfo(final String path, final GolangAttributes golangAttributes) { checkNotNull(path); checkNotNull(golangAttributes); String newPath = getZipAssetPathFromInfoPath(path); StreamPayload streamPayload = extractInfoFromZip(golangAttributes, newPath); if (streamPayload == null) { return null; } return new Content(streamPayload); } }
GolangHostedFacetImpl extends FacetSupport implements GolangHostedFacet { @Override @Nullable @Transactional public Content getInfo(final String path, final GolangAttributes golangAttributes) { checkNotNull(path); checkNotNull(golangAttributes); String newPath = getZipAssetPathFromInfoPath(path); StreamPayload streamPayload = extractInfoFromZip(golangAttributes, newPath); if (streamPayload == null) { return null; } return new Content(streamPayload); } @Inject  GolangHostedFacetImpl(final GolangDataAccess golangDataAccess,
                               final CompressedContentExtractor compressedContentExtractor); }
GolangHostedFacetImpl extends FacetSupport implements GolangHostedFacet { @Override @Nullable @Transactional public Content getInfo(final String path, final GolangAttributes golangAttributes) { checkNotNull(path); checkNotNull(golangAttributes); String newPath = getZipAssetPathFromInfoPath(path); StreamPayload streamPayload = extractInfoFromZip(golangAttributes, newPath); if (streamPayload == null) { return null; } return new Content(streamPayload); } @Inject  GolangHostedFacetImpl(final GolangDataAccess golangDataAccess,
                               final CompressedContentExtractor compressedContentExtractor); @Override @Nullable @Transactional Content getInfo(final String path,
                         final GolangAttributes golangAttributes); @Transactional @Override Content getList(final String module); @Nullable @TransactionalTouchBlob @Override Content getPackage(final String path); @Nullable @TransactionalTouchBlob @Override Content getMod(final String path); @Override void upload(final String path,
                     final GolangAttributes golangAttributes,
                     final Payload payload,
                     final AssetKind assetKind); }
GolangHostedFacetImpl extends FacetSupport implements GolangHostedFacet { @Override @Nullable @Transactional public Content getInfo(final String path, final GolangAttributes golangAttributes) { checkNotNull(path); checkNotNull(golangAttributes); String newPath = getZipAssetPathFromInfoPath(path); StreamPayload streamPayload = extractInfoFromZip(golangAttributes, newPath); if (streamPayload == null) { return null; } return new Content(streamPayload); } @Inject  GolangHostedFacetImpl(final GolangDataAccess golangDataAccess,
                               final CompressedContentExtractor compressedContentExtractor); @Override @Nullable @Transactional Content getInfo(final String path,
                         final GolangAttributes golangAttributes); @Transactional @Override Content getList(final String module); @Nullable @TransactionalTouchBlob @Override Content getPackage(final String path); @Nullable @TransactionalTouchBlob @Override Content getMod(final String path); @Override void upload(final String path,
                     final GolangAttributes golangAttributes,
                     final Payload payload,
                     final AssetKind assetKind);  }