DTOConverter { public static ToBeSigned toToBeSigned(ToBeSignedDTO toBeSignedDTO) { if (toBeSignedDTO != null) { return new ToBeSigned(toBeSignedDTO.getBytes()); } return null; }  static ToBeSigned toToBeSigned(ToBeSignedDTO toBeSignedDTO); static ToBeSignedDTO toToBeSignedDTO(ToBeSigned toBeSigned); static SignatureValue toSignatureValue(SignatureValueDTO signatureValueDTO); static SignatureValueDTO toSignatureValueDTO(SignatureValue signatureValue); static Digest toDigest(DigestDTO digestDTO); static DigestDTO toDigestDTO(Digest digest);  }
@Test public void toToBeSignedTest() { ToBeSignedDTO toBeSignedDTO = new ToBeSignedDTO(new byte[] {'1','2','3'}); ToBeSigned toBeSigned = DTOConverter.toToBeSigned(toBeSignedDTO); assertTrue(Arrays.equals(toBeSignedDTO.getBytes(), toBeSigned.getBytes())); assertEquals(toBeSignedDTO.hashCode(), toBeSigned.hashCode()); }
@Test public void toToBeSignedNullByteArrayTest() { ToBeSignedDTO toBeSignedDTO = new ToBeSignedDTO(null); ToBeSigned toBeSigned = DTOConverter.toToBeSigned(toBeSignedDTO); assertTrue(Arrays.equals(toBeSignedDTO.getBytes(), toBeSigned.getBytes())); assertEquals(toBeSignedDTO.hashCode(), toBeSigned.hashCode()); }
@Test public void toToBeSignedNullTest() { ToBeSigned toBeSigned = DTOConverter.toToBeSigned(null); assertNull(toBeSigned); }