EncryptDQLResultDecorator implements ResultDecorator { @Override public MergedResult decorate(final QueryResult queryResult, final SQLStatementContext<?> sqlStatementContext, final SchemaMetaData schemaMetaData) { return new EncryptMergedResult(metaData, new TransparentMergedResult(queryResult), queryWithCipherColumn); }  @Override MergedResult decorate(final QueryResult queryResult, final SQLStatementContext<?> sqlStatementContext, final SchemaMetaData schemaMetaData); @Override MergedResult decorate(final MergedResult mergedResult, final SQLStatementContext<?> sqlStatementContext, final SchemaMetaData schemaMetaData);  }
@Test public void assertDecorateQueryResult() throws SQLException { QueryResult queryResult = mock(QueryResult.class); when(queryResult.next()).thenReturn(true); EncryptDQLResultDecorator decorator = new EncryptDQLResultDecorator(metaData, queryWithCipherColumn); MergedResult actual = decorator.decorate(queryResult, mock(SQLStatementContext.class), mock(SchemaMetaData.class)); assertTrue(actual.next()); }
@Test public void assertDecorateMergedResult() throws SQLException { MergedResult mergedResult = mock(MergedResult.class); when(mergedResult.next()).thenReturn(true); EncryptDQLResultDecorator decorator = new EncryptDQLResultDecorator(metaData, queryWithCipherColumn); MergedResult actual = decorator.decorate(mergedResult, mock(SQLStatementContext.class), mock(SchemaMetaData.class)); assertTrue(actual.next()); }