use of io.codekvast.javaagent.model.v1.CodeBasePublication in project codekvast by crispab.
the class MariadbIntegrationTest method should_import_codeBasePublication1.
@SuppressWarnings("deprecation")
@Test
public void should_import_codeBasePublication1() {
// @formatter:off
CodeBasePublication publication = CodeBasePublication.builder().commonData(CommonPublicationData.sampleCommonPublicationData()).entries(Arrays.asList(CodeBaseEntry.sampleCodeBaseEntry())).overriddenSignatures(Collections.singletonMap("signature", "overriddenBySignature")).strangeSignatures(Collections.singletonMap("rawStrangeSignature", "normalizedStrangeSignature")).build();
// @formatter:on
codeBaseImporter.importPublication(CodeBasePublication2.fromV1Format(publication));
}
use of io.codekvast.javaagent.model.v1.CodeBasePublication in project codekvast by crispab.
the class CodeBasePublication2Test method should_transform_from_v1_format.
@SuppressWarnings("deprecation")
@Test
public void should_transform_from_v1_format() {
CodeBasePublication pub1 = CodeBasePublication.builder().commonData(CommonPublicationData.sampleCommonPublicationData()).entries(Collections.singletonList(CodeBaseEntry.sampleCodeBaseEntry())).overriddenSignatures(Collections.singletonMap("key1", "value1")).strangeSignatures(Collections.singletonMap("key2", "value2")).build();
CodeBasePublication2 pub2 = CodeBasePublication2.fromV1Format(pub1);
assertThat(pub2.getCommonData(), is(CommonPublicationData2.sampleCommonPublicationData()));
assertThat(pub2.getEntries(), hasItems(CodeBaseEntry2.sampleCodeBaseEntry()));
}
use of io.codekvast.javaagent.model.v1.CodeBasePublication in project codekvast by crispab.
the class PublicationV1DeserializationTest method should_deserialize_codebaseV1_file.
@Test
public void should_deserialize_codebaseV1_file() throws IOException, ClassNotFoundException {
ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(getClass().getResourceAsStream(CODEBASE_RESOURCE)));
CodeBasePublication publication = (CodeBasePublication) ois.readObject();
assertThat(publication, isA(CodeBasePublication.class));
}
Aggregations