Skip to content

Commit 4239394

Browse files
committed
Rename test method names for clarity
1 parent 4b42d0d commit 4239394

File tree

7 files changed

+40
-40
lines changed

7 files changed

+40
-40
lines changed

athena-oracle/src/test/java/com/amazonaws/athena/connectors/oracle/OracleEnvironmentPropertiesTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ public void setUp()
5050
}
5151

5252
@Test
53-
public void connectionPropertiesToEnvironment_whenSSLNotEnabled_returnsConnectionStringWithoutSSL()
53+
public void connectionPropertiesToEnvironment_withoutSSLEnabled_returnsConnectionStringWithoutSSL()
5454
{
5555
Map<String, String> oracleConnectionProperties = oracleEnvironmentProperties.connectionPropertiesToEnvironment(connectionProperties);
5656
String expectedConnectionString = "oracle://jdbc:oracle:thin:${oracle-secret}@//test.oracle.com:1521/orcl";
5757
assertEquals(expectedConnectionString, oracleConnectionProperties.get(DEFAULT));
5858
}
5959

6060
@Test
61-
public void connectionPropertiesToEnvironment_whenSSLEnabled_returnsConnectionStringWithSSL()
61+
public void connectionPropertiesToEnvironment_withSSLEnabled_returnsConnectionStringWithSSL()
6262
{
6363
connectionProperties.put(ENFORCE_SSL, "true");
6464
Map<String, String> oracleConnectionProperties = oracleEnvironmentProperties.connectionPropertiesToEnvironment(connectionProperties);

athena-oracle/src/test/java/com/amazonaws/athena/connectors/oracle/OracleJdbcConnectionFactoryTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class OracleJdbcConnectionFactoryTest
5050
private static final String PASSWORD = "password";
5151

5252
@Test
53-
public void getConnection_whenUsingSslConnection_setsSslProperties() throws Exception
53+
public void getConnection_withSslConnection_setsSslProperties() throws Exception
5454
{
5555
Driver mockDriver = mock(Driver.class);
5656

@@ -109,7 +109,7 @@ protected Map<String, String> getEnvMap()
109109
}
110110

111111
@Test(expected = RuntimeException.class)
112-
public void getConnection_whenCredentialsProviderIsNull_throwsRuntimeException()
112+
public void getConnection_withNullCredentialsProvider_throwsRuntimeException()
113113
{
114114
DatabaseConnectionConfig config = new DatabaseConnectionConfig(
115115
TEST_CATALOG, OracleConstants.ORACLE_NAME,
@@ -143,7 +143,7 @@ public void getConnection_whenDriverFailsToConnect_throwsRuntimeException() thro
143143
}
144144

145145
@Test(expected = RuntimeException.class)
146-
public void getConnection_whenDriverClassNotFound_throwsRuntimeException()
146+
public void getConnection_withInvalidDriverClass_throwsRuntimeException()
147147
{
148148
DefaultCredentials credentials = new DefaultCredentials(USERNAME, PASSWORD);
149149
CredentialsProvider credentialsProvider = new StaticCredentialsProvider(credentials);

athena-oracle/src/test/java/com/amazonaws/athena/connectors/oracle/OracleMetadataHandlerTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ public void tearDown()
121121
}
122122

123123
@Test
124-
public void getPartitionSchema_whenCalled_returnsPartitionSchema()
124+
public void getPartitionSchema_returnsPartitionSchema()
125125
{
126126
assertEquals(SchemaBuilder.newBuilder()
127127
.addField(OracleMetadataHandler.BLOCK_PARTITION_COLUMN_NAME, org.apache.arrow.vector.types.Types.MinorType.VARCHAR.getType()).build(),
128128
this.oracleMetadataHandler.getPartitionSchema(CATALOG_NAME));
129129
}
130130

131131
@Test
132-
public void doGetTableLayout_whenTableHasPartitions_returnsPartitionLayout()
132+
public void doGetTableLayout_withPartitions_returnsPartitionLayout()
133133
throws Exception
134134
{
135135
Constraints constraints = Mockito.mock(Constraints.class);
@@ -169,7 +169,7 @@ public void doGetTableLayout_whenTableHasPartitions_returnsPartitionLayout()
169169
}
170170

171171
@Test
172-
public void doGetTableLayout_whenTableHasNoPartitions_returnsDefaultPartition()
172+
public void doGetTableLayout_withoutPartitions_returnsDefaultPartition()
173173
throws Exception
174174
{
175175
Constraints constraints = Mockito.mock(Constraints.class);
@@ -228,7 +228,7 @@ public void doGetTableLayout_whenSQLExceptionOccurs_throwsRuntimeException()
228228
}
229229

230230
@Test
231-
public void doGetSplits_whenPartitionsExist_returnsSplitsForAllPartitions()
231+
public void doGetSplits_withPartitions_returnsSplitsForAllPartitions()
232232
throws Exception
233233
{
234234
Constraints constraints = Mockito.mock(Constraints.class);
@@ -264,7 +264,7 @@ public void doGetSplits_whenPartitionsExist_returnsSplitsForAllPartitions()
264264
}
265265

266266
@Test
267-
public void doGetSplits_whenContinuationTokenProvided_returnsRemainingSplits()
267+
public void doGetSplits_withContinuationToken_returnsRemainingSplits()
268268
throws Exception
269269
{
270270
Constraints constraints = Mockito.mock(Constraints.class);
@@ -298,7 +298,7 @@ public void doGetSplits_whenContinuationTokenProvided_returnsRemainingSplits()
298298
}
299299

300300
@Test
301-
public void doGetSplits_whenQueryPassthroughArgsProvided_returnsSplitWithPassthroughArgs()
301+
public void doGetSplits_withQueryPassthroughArgs_returnsSplitWithPassthroughArgs()
302302
{
303303
TableName tableName = new TableName("testSchema", "testTable");
304304

@@ -339,7 +339,7 @@ public void doGetSplits_whenQueryPassthroughArgsProvided_returnsSplitWithPassthr
339339
}
340340

341341
@Test
342-
public void doListTables_whenCalledWithPagination_returnsPaginatedTables()
342+
public void doListTables_withPagination_returnsPaginatedTables()
343343
throws Exception
344344
{
345345
PreparedStatement preparedStatement = Mockito.mock(PreparedStatement.class);
@@ -371,7 +371,7 @@ blockAllocator, new ListTablesRequest(this.federatedIdentity, "testQueryId",
371371
}
372372

373373
@Test
374-
public void doGetTable_whenCalled_returnsTableSchemaWithColumns()
374+
public void doGetTable_returnsTableSchemaWithColumns()
375375
throws Exception
376376
{
377377
String[] schema = {"DATA_TYPE", "COLUMN_SIZE", "COLUMN_NAME", "DECIMAL_DIGITS", "NUM_PREC_RADIX"};
@@ -410,7 +410,7 @@ public void doGetTable_whenCalled_returnsTableSchemaWithColumns()
410410
}
411411

412412
@Test
413-
public void doGetTable_whenUnsupportedColumnTypes_fallbackToVarchar() throws Exception
413+
public void doGetTable_withUnsupportedColumnTypes_fallsBackToVarchar() throws Exception
414414
{
415415
String[] schema = {"DATA_TYPE", "COLUMN_SIZE", "COLUMN_NAME", "DECIMAL_DIGITS", "NUM_PREC_RADIX"};
416416

@@ -444,7 +444,7 @@ public void doGetTable_whenUnsupportedColumnTypes_fallbackToVarchar() throws Exc
444444
}
445445

446446
@Test
447-
public void doGetDataSourceCapabilities_whenCalled_returnsSupportedCapabilities()
447+
public void doGetDataSourceCapabilities_returnsSupportedCapabilities()
448448
{
449449
GetDataSourceCapabilitiesRequest request =
450450
new GetDataSourceCapabilitiesRequest(federatedIdentity, QUERY_ID, CATALOG_NAME);

athena-oracle/src/test/java/com/amazonaws/athena/connectors/oracle/OracleMuxJdbcMetadataHandlerTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void setup()
7272
}
7373

7474
@Test
75-
public void doListSchemaNames_whenCalled_delegatesToOracleHandler()
75+
public void doListSchemaNames_delegatesToOracleMetadataHandler()
7676
throws Exception
7777
{
7878
ListSchemasRequest listSchemasRequest = Mockito.mock(ListSchemasRequest.class);
@@ -82,7 +82,7 @@ public void doListSchemaNames_whenCalled_delegatesToOracleHandler()
8282
}
8383

8484
@Test
85-
public void doListTables_whenCalled_delegatesToOracleHandler()
85+
public void doListTables_delegatesToOracleMetadataHandler()
8686
throws Exception
8787
{
8888
ListTablesRequest listTablesRequest = Mockito.mock(ListTablesRequest.class);
@@ -92,7 +92,7 @@ public void doListTables_whenCalled_delegatesToOracleHandler()
9292
}
9393

9494
@Test
95-
public void doGetTable_whenCalled_delegatesToOracleHandler()
95+
public void doGetTable_delegatesToOracleMetadataHandler()
9696
throws Exception
9797
{
9898
GetTableRequest getTableRequest = Mockito.mock(GetTableRequest.class);
@@ -102,7 +102,7 @@ public void doGetTable_whenCalled_delegatesToOracleHandler()
102102
}
103103

104104
@Test
105-
public void doGetTableLayout_whenCalled_delegatesToOracleHandler()
105+
public void doGetTableLayout_delegatesToOracleMetadataHandler()
106106
throws Exception
107107
{
108108
GetTableLayoutRequest getTableLayoutRequest = Mockito.mock(GetTableLayoutRequest.class);
@@ -113,20 +113,20 @@ public void doGetTableLayout_whenCalled_delegatesToOracleHandler()
113113
}
114114

115115
@Test
116-
public void getPartitionSchema_whenCalled_delegatesToOracleHandler()
116+
public void getPartitionSchema_delegatesToOracleMetadataHandler()
117117
{
118118
this.jdbcMetadataHandler.getPartitionSchema("fakedatabase");
119119
Mockito.verify(this.oracleMetadataHandler, Mockito.times(1)).getPartitionSchema(Mockito.eq("fakedatabase"));
120120
}
121121

122122
@Test(expected = RuntimeException.class)
123-
public void getPartitionSchema_whenCatalogIsUnsupported_throwsRuntimeException()
123+
public void getPartitionSchema_withUnsupportedCatalog_throwsRuntimeException()
124124
{
125125
this.jdbcMetadataHandler.getPartitionSchema("unsupportedCatalog");
126126
}
127127

128128
@Test
129-
public void getPartitions_whenCalled_delegatesToOracleHandler()
129+
public void getPartitions_delegatesToOracleMetadataHandler()
130130
throws Exception
131131
{
132132
GetTableLayoutRequest getTableLayoutRequest = Mockito.mock(GetTableLayoutRequest.class);
@@ -136,7 +136,7 @@ public void getPartitions_whenCalled_delegatesToOracleHandler()
136136
}
137137

138138
@Test
139-
public void doGetSplits_whenCalled_delegatesToOracleHandler()
139+
public void doGetSplits_delegatesToOracleMetadataHandler()
140140
{
141141
GetSplitsRequest getSplitsRequest = Mockito.mock(GetSplitsRequest.class);
142142
Mockito.when(getSplitsRequest.getCatalogName()).thenReturn("fakedatabase");

athena-oracle/src/test/java/com/amazonaws/athena/connectors/oracle/OracleMuxJdbcRecordHandlerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void setup()
6868
}
6969

7070
@Test
71-
public void readWithConstraint_whenCalled_delegatesToOracleHandler()
71+
public void readWithConstraint_delegatesToOracleRecordHandler()
7272
throws Exception
7373
{
7474
BlockSpiller blockSpiller = Mockito.mock(BlockSpiller.class);
@@ -79,7 +79,7 @@ public void readWithConstraint_whenCalled_delegatesToOracleHandler()
7979
}
8080

8181
@Test(expected = RuntimeException.class)
82-
public void readWithConstraint_whenCatalogIsUnsupported_throwsRuntimeException()
82+
public void readWithConstraint_withUnsupportedCatalog_throwsRuntimeException()
8383
throws Exception
8484
{
8585
BlockSpiller blockSpiller = Mockito.mock(BlockSpiller.class);
@@ -89,7 +89,7 @@ public void readWithConstraint_whenCatalogIsUnsupported_throwsRuntimeException()
8989
}
9090

9191
@Test
92-
public void buildSplitSql_whenCalled_delegatesToOracleHandler()
92+
public void buildSplitSql_delegatesToOracleRecordHandler()
9393
throws SQLException
9494
{
9595
ReadRecordsRequest readRecordsRequest = Mockito.mock(ReadRecordsRequest.class);

athena-oracle/src/test/java/com/amazonaws/athena/connectors/oracle/OracleRecordHandlerTest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public void setup()
106106
}
107107

108108
@Test
109-
public void buildSplitSql_whenCalledWithConstraints_returnsPreparedStatement()
109+
public void buildSplitSql_withConstraints_returnsPreparedStatement()
110110
throws SQLException
111111
{
112112
TableName tableName = new TableName("testSchema", "testTable");
@@ -213,7 +213,7 @@ private ValueSet getRangeSet(Marker.Bound lowerBound, Object lowerValue, Marker.
213213
}
214214

215215
@Test
216-
public void buildSplitSql_whenCalledWithComplexExpressions_buildsCorrectSQL() throws SQLException
216+
public void buildSplitSql_withComplexExpressions_buildsSQLWithNestedPredicates() throws SQLException
217217
{
218218
TableName tableName = new TableName(TEST_SCHEMA, TEST_TABLE);
219219
SchemaBuilder schemaBuilder = SchemaBuilder.newBuilder();
@@ -256,7 +256,7 @@ public void buildSplitSql_whenCalledWithComplexExpressions_buildsCorrectSQL() th
256256
}
257257

258258
@Test
259-
public void buildSplitSql_whenCalledWithTopN_buildsCorrectSQL() throws SQLException
259+
public void buildSplitSql_withTopN_includesFetchFirstClause() throws SQLException
260260
{
261261
TableName tableName = new TableName(TEST_SCHEMA, TEST_TABLE);
262262
Schema schema = createSchemaWithValueField().build();
@@ -273,7 +273,7 @@ public void buildSplitSql_whenCalledWithTopN_buildsCorrectSQL() throws SQLExcept
273273
}
274274

275275
@Test
276-
public void buildSplitSql_whenCalledWithOrderBy_buildsCorrectSQL() throws SQLException
276+
public void buildSplitSql_withOrderBy_includesOrderByClause() throws SQLException
277277
{
278278
TableName tableName = new TableName(TEST_SCHEMA, TEST_TABLE);
279279
SchemaBuilder schemaBuilder = createSchemaWithCommonFields();
@@ -304,7 +304,7 @@ public void buildSplitSql_whenCalledWithOrderBy_buildsCorrectSQL() throws SQLExc
304304
}
305305

306306
@Test
307-
public void buildSplitSql_whenCalledWithLimitOffset_buildsCorrectSQL() throws SQLException
307+
public void buildSplitSql_withLimitOffset_includesLimitAndOffsetClauses() throws SQLException
308308
{
309309
TableName tableName = new TableName(TEST_SCHEMA, TEST_TABLE);
310310
Schema schema = createSchemaWithValueField().build();
@@ -321,7 +321,7 @@ public void buildSplitSql_whenCalledWithLimitOffset_buildsCorrectSQL() throws SQ
321321
}
322322

323323
@Test
324-
public void buildSplitSql_whenCalledWithRangeAndInPredicates_buildsCorrectSQL() throws SQLException
324+
public void buildSplitSql_withRangeAndInPredicates_buildsSQLWithCombinedWhereClause() throws SQLException
325325
{
326326
TableName tableName = new TableName(TEST_SCHEMA, TEST_TABLE);
327327
SchemaBuilder schemaBuilder = createBasicSchemaBuilder();
@@ -369,7 +369,7 @@ public void buildSplitSql_whenCalledWithRangeAndInPredicates_buildsCorrectSQL()
369369
}
370370

371371
@Test
372-
public void buildSplitSql_whenCalledWithDifferentDataTypes_buildsCorrectSQL() throws SQLException
372+
public void buildSplitSql_withDifferentDataTypes_handlesAllDataTypesCorrectly() throws SQLException
373373
{
374374
TableName tableName = new TableName(TEST_SCHEMA, TEST_TABLE);
375375
SchemaBuilder schemaBuilder = createBasicSchemaBuilder();
@@ -411,7 +411,7 @@ public void buildSplitSql_whenCalledWithDifferentDataTypes_buildsCorrectSQL() th
411411
}
412412

413413
@Test
414-
public void buildSplitSql_whenCalledWithQueryPassthrough_returnsPassthroughQuery() throws SQLException
414+
public void buildSplitSql_withQueryPassthrough_returnsPassthroughQuery() throws SQLException
415415
{
416416
TableName tableName = new TableName(TEST_SCHEMA, TEST_TABLE);
417417
Schema schema = createSchemaWithCommonFields().build();
@@ -439,7 +439,7 @@ public void buildSplitSql_whenCalledWithQueryPassthrough_returnsPassthroughQuery
439439
}
440440

441441
@Test
442-
public void buildSplitSql_whenCalledWithEmptyConstraints_buildsBasicQuery() throws SQLException
442+
public void buildSplitSql_withEmptyConstraints_buildsBasicQuery() throws SQLException
443443
{
444444
TableName tableName = new TableName(TEST_SCHEMA, TEST_TABLE);
445445
Schema schema = createSchemaWithCommonFields().build();
@@ -463,7 +463,7 @@ public void buildSplitSql_whenCalledWithEmptyConstraints_buildsBasicQuery() thro
463463
}
464464

465465
@Test
466-
public void buildSplitSql_whenCalledWithEmptyConstraintsAndOrderBy_buildsQueryWithOrderBy() throws SQLException
466+
public void buildSplitSql_withEmptyConstraintsAndOrderBy_buildsQueryWithOrderBy() throws SQLException
467467
{
468468
TableName tableName = new TableName(TEST_SCHEMA, TEST_TABLE);
469469
Schema schema = createSchemaWithCommonFields().build();
@@ -491,7 +491,7 @@ public void buildSplitSql_whenCalledWithEmptyConstraintsAndOrderBy_buildsQueryWi
491491
}
492492

493493
@Test(expected = AthenaConnectorException.class)
494-
public void buildSplitSql_whenCalledWithInvalidQueryPassthrough_throwsAthenaConnectorException() throws SQLException
494+
public void buildSplitSql_withInvalidQueryPassthrough_throwsAthenaConnectorException() throws SQLException
495495
{
496496
TableName tableName = new TableName(TEST_SCHEMA, TEST_TABLE);
497497
SchemaBuilder schemaBuilder = createBasicSchemaBuilder();

athena-oracle/src/test/java/com/amazonaws/athena/connectors/oracle/resolver/OracleJDBCCaseResolverTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void setup() throws SQLException
6060
}
6161

6262
@Test
63-
public void getAdjustedSchemaNameString_whenCaseInsensitiveMode_schemaNameCasingAdjusted() throws SQLException
63+
public void getAdjustedSchemaNameString_withCaseInsensitiveMode_schemaNameIsLowerCased() throws SQLException
6464
{
6565
DefaultJDBCCaseResolver resolver = new OracleJDBCCaseResolver(ORACLE_ENGINE);
6666

@@ -81,7 +81,7 @@ public void getAdjustedSchemaNameString_whenCaseInsensitiveMode_schemaNameCasing
8181
}
8282

8383
@Test
84-
public void getAdjustedTableNameString_whenCaseInsensitiveMode_tableNameCasingAdjusted() throws SQLException
84+
public void getAdjustedTableNameString_withCaseInsensitiveMode_tableNameIsUpperCased() throws SQLException
8585
{
8686
DefaultJDBCCaseResolver resolver = new OracleJDBCCaseResolver(ORACLE_ENGINE);
8787

@@ -103,7 +103,7 @@ public void getAdjustedTableNameString_whenCaseInsensitiveMode_tableNameCasingAd
103103
}
104104

105105
@Test
106-
public void getAdjustedTableNameObject_whenCaseInsensitiveMode_objectCasingAdjusted() throws SQLException
106+
public void getAdjustedTableNameObject_withCaseInsensitiveMode_schemaIsLowerCasedAndTableIsUpperCased() throws SQLException
107107
{
108108
DefaultJDBCCaseResolver resolver = new OracleJDBCCaseResolver(ORACLE_ENGINE);
109109

0 commit comments

Comments
 (0)