use of com.structurizr.io.json.JsonWriter in project java by structurizr.
the class EncryptedWorkspaceTests method test_construction_WhenThreeParametersAreSpecified.
@Test
public void test_construction_WhenThreeParametersAreSpecified() throws Exception {
JsonWriter jsonWriter = new JsonWriter(false);
StringWriter stringWriter = new StringWriter();
jsonWriter.write(workspace, stringWriter);
encryptedWorkspace = new EncryptedWorkspace(workspace, stringWriter.toString(), encryptionStrategy);
assertEquals("Name", encryptedWorkspace.getName());
assertEquals("Description", encryptedWorkspace.getDescription());
assertEquals("1.2.3", encryptedWorkspace.getVersion());
assertEquals("simon", encryptedWorkspace.getLastModifiedUser());
assertEquals("structurizr-java", encryptedWorkspace.getLastModifiedAgent());
assertEquals(1234, encryptedWorkspace.getId());
assertSame(workspace, encryptedWorkspace.getWorkspace());
assertSame(encryptionStrategy, encryptedWorkspace.getEncryptionStrategy());
assertEquals(stringWriter.toString(), encryptedWorkspace.getPlaintext());
assertEquals(encryptionStrategy.encrypt(stringWriter.toString()), encryptedWorkspace.getCiphertext());
}
Aggregations