### Question:
AwsRdsInstanceView { public String getEngine() { if (databaseServer.getEngine() == null) { return null; } switch (databaseServer.getEngine()) { case POSTGRESQL: return "postgres"; default: throw new IllegalStateException("Unsupported RDS engine " + databaseServer.getEngine()); } } AwsRdsInstanceView(DatabaseServer databaseServer); Long getAllocatedStorage(); Integer getBackupRetentionPeriod(); String getDBInstanceClass(); String getDBInstanceIdentifier(); String getEngine(); String getEngineVersion(); String getMasterUsername(); String getMasterUserPassword(); String getMultiAZ(); String getStorageType(); List<String> getVPCSecurityGroups();  }### Answer:
@Test public void testEnginePostgres() { when(server.getEngine()).thenReturn(DatabaseEngine.POSTGRESQL); assertEquals("postgres", underTest.getEngine()); }
@Test public void testNoEngine() { when(server.getEngine()).thenReturn(null); assertNull(underTest.getEngine()); }