target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test void testDetermineCurrentUserWithSetUser() { VariableHandling.set(execution, Variables.USER, EXAMPLE_USER); String determinedUser = StepsUtil.determineCurrentUser(execution); assertEquals(EXAMPLE_USER, determinedUser); } | public static String determineCurrentUser(VariableScope scope) { String user = VariableHandling.get(scope, Variables.USER); if (user == null) { throw new SLException(Messages.CANT_DETERMINE_CURRENT_USER); } return user; } | StepsUtil { public static String determineCurrentUser(VariableScope scope) { String user = VariableHandling.get(scope, Variables.USER); if (user == null) { throw new SLException(Messages.CANT_DETERMINE_CURRENT_USER); } return user; } } | StepsUtil { public static String determineCurrentUser(VariableScope scope) { String user = VariableHandling.get(scope, Variables.USER); if (user == null) { throw new SLException(Messages.CANT_DETERMINE_CURRENT_USER); } return user; } protected StepsUtil(); } | StepsUtil { public static String determineCurrentUser(VariableScope scope) { String user = VariableHandling.get(scope, Variables.USER); if (user == null) { throw new SLException(Messages.CANT_DETERMINE_CURRENT_USER); } return user; } protected StepsUtil(); static String determineCurrentUser(VariableScope scope); stati... | StepsUtil { public static String determineCurrentUser(VariableScope scope) { String user = VariableHandling.get(scope, Variables.USER); if (user == null) { throw new SLException(Messages.CANT_DETERMINE_CURRENT_USER); } return user; } protected StepsUtil(); static String determineCurrentUser(VariableScope scope); stati... |
@Test void testDetermineCurrentUserError() { Assertions.assertThrows(SLException.class, () -> StepsUtil.determineCurrentUser(execution)); } | public static String determineCurrentUser(VariableScope scope) { String user = VariableHandling.get(scope, Variables.USER); if (user == null) { throw new SLException(Messages.CANT_DETERMINE_CURRENT_USER); } return user; } | StepsUtil { public static String determineCurrentUser(VariableScope scope) { String user = VariableHandling.get(scope, Variables.USER); if (user == null) { throw new SLException(Messages.CANT_DETERMINE_CURRENT_USER); } return user; } } | StepsUtil { public static String determineCurrentUser(VariableScope scope) { String user = VariableHandling.get(scope, Variables.USER); if (user == null) { throw new SLException(Messages.CANT_DETERMINE_CURRENT_USER); } return user; } protected StepsUtil(); } | StepsUtil { public static String determineCurrentUser(VariableScope scope) { String user = VariableHandling.get(scope, Variables.USER); if (user == null) { throw new SLException(Messages.CANT_DETERMINE_CURRENT_USER); } return user; } protected StepsUtil(); static String determineCurrentUser(VariableScope scope); stati... | StepsUtil { public static String determineCurrentUser(VariableScope scope) { String user = VariableHandling.get(scope, Variables.USER); if (user == null) { throw new SLException(Messages.CANT_DETERMINE_CURRENT_USER); } return user; } protected StepsUtil(); static String determineCurrentUser(VariableScope scope); stati... |
@Test void testErrorMessage() { Assertions.assertEquals(Messages.ERROR_DETECTING_COMPONENTS_TO_UNDEPLOY, step.getStepErrorMessage(context)); } | @Override protected String getStepErrorMessage(ProcessContext context) { return Messages.ERROR_DETECTING_COMPONENTS_TO_UNDEPLOY; } | PrepareToUndeployStep extends SyncFlowableStep { @Override protected String getStepErrorMessage(ProcessContext context) { return Messages.ERROR_DETECTING_COMPONENTS_TO_UNDEPLOY; } } | PrepareToUndeployStep extends SyncFlowableStep { @Override protected String getStepErrorMessage(ProcessContext context) { return Messages.ERROR_DETECTING_COMPONENTS_TO_UNDEPLOY; } } | PrepareToUndeployStep extends SyncFlowableStep { @Override protected String getStepErrorMessage(ProcessContext context) { return Messages.ERROR_DETECTING_COMPONENTS_TO_UNDEPLOY; } } | PrepareToUndeployStep extends SyncFlowableStep { @Override protected String getStepErrorMessage(ProcessContext context) { return Messages.ERROR_DETECTING_COMPONENTS_TO_UNDEPLOY; } } |
@Test void rollback() throws SQLException { Connection connection = Mockito.mock(Connection.class); Mockito.when(connection.getAutoCommit()) .thenReturn(false); JdbcUtil.rollback(connection); Mockito.verify(connection) .rollback(); } | public static void rollback(Connection connection) throws SQLException { if (connection == null) { return; } if (!connection.getAutoCommit()) { connection.rollback(); } } | JdbcUtil { public static void rollback(Connection connection) throws SQLException { if (connection == null) { return; } if (!connection.getAutoCommit()) { connection.rollback(); } } } | JdbcUtil { public static void rollback(Connection connection) throws SQLException { if (connection == null) { return; } if (!connection.getAutoCommit()) { connection.rollback(); } } private JdbcUtil(); } | JdbcUtil { public static void rollback(Connection connection) throws SQLException { if (connection == null) { return; } if (!connection.getAutoCommit()) { connection.rollback(); } } private JdbcUtil(); static void closeQuietly(ResultSet resultSet); static void closeQuietly(Statement statement); static void closeQuietl... | JdbcUtil { public static void rollback(Connection connection) throws SQLException { if (connection == null) { return; } if (!connection.getAutoCommit()) { connection.rollback(); } } private JdbcUtil(); static void closeQuietly(ResultSet resultSet); static void closeQuietly(Statement statement); static void closeQuietl... |
@Test void testDefaultDomainNotFoundException() { prepareDescriptor("system-parameters/mtad.yaml"); prepareClient(); when(client.getDefaultDomain()).thenThrow(new CloudOperationException(HttpStatus.NOT_FOUND)); step.execute(execution); assertTrue(context.getVariable(Variables.MISSING_DEFAULT_DOMAIN)); DeploymentDescrip... | private String getDefaultDomain(CloudControllerClient client, ProcessContext context) { try { return client.getDefaultDomain() .getName(); } catch (CloudOperationException e) { if (e.getStatusCode() == HttpStatus.NOT_FOUND) { context.setVariable(Variables.MISSING_DEFAULT_DOMAIN, true); return DEFAULT_DOMAIN_PLACEHOLDER... | CollectSystemParametersStep extends SyncFlowableStep { private String getDefaultDomain(CloudControllerClient client, ProcessContext context) { try { return client.getDefaultDomain() .getName(); } catch (CloudOperationException e) { if (e.getStatusCode() == HttpStatus.NOT_FOUND) { context.setVariable(Variables.MISSING_D... | CollectSystemParametersStep extends SyncFlowableStep { private String getDefaultDomain(CloudControllerClient client, ProcessContext context) { try { return client.getDefaultDomain() .getName(); } catch (CloudOperationException e) { if (e.getStatusCode() == HttpStatus.NOT_FOUND) { context.setVariable(Variables.MISSING_D... | CollectSystemParametersStep extends SyncFlowableStep { private String getDefaultDomain(CloudControllerClient client, ProcessContext context) { try { return client.getDefaultDomain() .getName(); } catch (CloudOperationException e) { if (e.getStatusCode() == HttpStatus.NOT_FOUND) { context.setVariable(Variables.MISSING_D... | CollectSystemParametersStep extends SyncFlowableStep { private String getDefaultDomain(CloudControllerClient client, ProcessContext context) { try { return client.getDefaultDomain() .getName(); } catch (CloudOperationException e) { if (e.getStatusCode() == HttpStatus.NOT_FOUND) { context.setVariable(Variables.MISSING_D... |
@Test void testDefaultDomainException() { when(client.getDefaultDomain()).thenThrow(new CloudOperationException(HttpStatus.GATEWAY_TIMEOUT)); assertThrows(SLException.class, () -> step.execute(execution)); } | private String getDefaultDomain(CloudControllerClient client, ProcessContext context) { try { return client.getDefaultDomain() .getName(); } catch (CloudOperationException e) { if (e.getStatusCode() == HttpStatus.NOT_FOUND) { context.setVariable(Variables.MISSING_DEFAULT_DOMAIN, true); return DEFAULT_DOMAIN_PLACEHOLDER... | CollectSystemParametersStep extends SyncFlowableStep { private String getDefaultDomain(CloudControllerClient client, ProcessContext context) { try { return client.getDefaultDomain() .getName(); } catch (CloudOperationException e) { if (e.getStatusCode() == HttpStatus.NOT_FOUND) { context.setVariable(Variables.MISSING_D... | CollectSystemParametersStep extends SyncFlowableStep { private String getDefaultDomain(CloudControllerClient client, ProcessContext context) { try { return client.getDefaultDomain() .getName(); } catch (CloudOperationException e) { if (e.getStatusCode() == HttpStatus.NOT_FOUND) { context.setVariable(Variables.MISSING_D... | CollectSystemParametersStep extends SyncFlowableStep { private String getDefaultDomain(CloudControllerClient client, ProcessContext context) { try { return client.getDefaultDomain() .getName(); } catch (CloudOperationException e) { if (e.getStatusCode() == HttpStatus.NOT_FOUND) { context.setVariable(Variables.MISSING_D... | CollectSystemParametersStep extends SyncFlowableStep { private String getDefaultDomain(CloudControllerClient client, ProcessContext context) { try { return client.getDefaultDomain() .getName(); } catch (CloudOperationException e) { if (e.getStatusCode() == HttpStatus.NOT_FOUND) { context.setVariable(Variables.MISSING_D... |
@Test void testGetHooksBeforeStep() { Mockito.when(hooksPhaseBuilder.buildHookPhases(List.of(HookPhase.APPLICATION_BEFORE_STOP_LIVE, HookPhase.BEFORE_STOP), context)) .thenReturn(List.of(HookPhase.BLUE_GREEN_APPLICATION_BEFORE_STOP_LIVE, HookPhase.APPLICATION_BEFORE_STOP_LIVE)); List<HookPhase> expectedPhases = List.of... | @Override public List<HookPhase> getHookPhasesBeforeStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_BEFORE_STOP_IDLE, HookPhase.APPLICATION_BEFORE_STOP_LIVE, context); hookPhases.add(HookPhase.BEFORE_STOP); return hooksPhaseBuilder.buildHookPhases(hookPhases, context); } | StopAppStep extends SyncFlowableStepWithHooks implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesBeforeStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_BEFORE_STOP_IDLE, HookPhase.APPLICATION_BEFORE_STOP_LIVE,... | StopAppStep extends SyncFlowableStepWithHooks implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesBeforeStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_BEFORE_STOP_IDLE, HookPhase.APPLICATION_BEFORE_STOP_LIVE,... | StopAppStep extends SyncFlowableStepWithHooks implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesBeforeStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_BEFORE_STOP_IDLE, HookPhase.APPLICATION_BEFORE_STOP_LIVE,... | StopAppStep extends SyncFlowableStepWithHooks implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesBeforeStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_BEFORE_STOP_IDLE, HookPhase.APPLICATION_BEFORE_STOP_LIVE,... |
@Test void testGetHooksBeforeStepWithBlueGreenProcess() { Mockito.when(processTypeParser.getProcessType(context.getExecution())) .thenReturn(ProcessType.BLUE_GREEN_DEPLOY); Mockito.when(hooksPhaseBuilder.buildHookPhases(List.of(HookPhase.APPLICATION_BEFORE_STOP_IDLE, HookPhase.BEFORE_STOP), context)) .thenReturn(List.o... | @Override public List<HookPhase> getHookPhasesBeforeStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_BEFORE_STOP_IDLE, HookPhase.APPLICATION_BEFORE_STOP_LIVE, context); hookPhases.add(HookPhase.BEFORE_STOP); return hooksPhaseBuilder.buildHookPhases(hookPhases, context); } | StopAppStep extends SyncFlowableStepWithHooks implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesBeforeStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_BEFORE_STOP_IDLE, HookPhase.APPLICATION_BEFORE_STOP_LIVE,... | StopAppStep extends SyncFlowableStepWithHooks implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesBeforeStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_BEFORE_STOP_IDLE, HookPhase.APPLICATION_BEFORE_STOP_LIVE,... | StopAppStep extends SyncFlowableStepWithHooks implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesBeforeStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_BEFORE_STOP_IDLE, HookPhase.APPLICATION_BEFORE_STOP_LIVE,... | StopAppStep extends SyncFlowableStepWithHooks implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesBeforeStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_BEFORE_STOP_IDLE, HookPhase.APPLICATION_BEFORE_STOP_LIVE,... |
@Test void testGetHooksAfterStep() { Mockito.when(hooksPhaseBuilder.buildHookPhases(List.of(HookPhase.APPLICATION_AFTER_STOP_LIVE, HookPhase.AFTER_STOP), context)) .thenReturn(List.of(HookPhase.BLUE_GREEN_APPLICATION_AFTER_STOP_LIVE, HookPhase.APPLICATION_AFTER_STOP_LIVE)); List<HookPhase> expectedPhases = List.of(Hook... | @Override public List<HookPhase> getHookPhasesAfterStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_AFTER_STOP_IDLE, HookPhase.APPLICATION_AFTER_STOP_LIVE, context); hookPhases.add(HookPhase.AFTER_STOP); return hooksPhaseBuilder.buildHookPhases(hookPhases, context); } | StopAppStep extends SyncFlowableStepWithHooks implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesAfterStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_AFTER_STOP_IDLE, HookPhase.APPLICATION_AFTER_STOP_LIVE, co... | StopAppStep extends SyncFlowableStepWithHooks implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesAfterStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_AFTER_STOP_IDLE, HookPhase.APPLICATION_AFTER_STOP_LIVE, co... | StopAppStep extends SyncFlowableStepWithHooks implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesAfterStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_AFTER_STOP_IDLE, HookPhase.APPLICATION_AFTER_STOP_LIVE, co... | StopAppStep extends SyncFlowableStepWithHooks implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesAfterStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_AFTER_STOP_IDLE, HookPhase.APPLICATION_AFTER_STOP_LIVE, co... |
@Test void testGetHooksAfterStepWithBlueGreenProcess() { Mockito.when(processTypeParser.getProcessType(context.getExecution())) .thenReturn(ProcessType.BLUE_GREEN_DEPLOY); Mockito.when(hooksPhaseBuilder.buildHookPhases(List.of(HookPhase.APPLICATION_AFTER_STOP_IDLE, HookPhase.AFTER_STOP), context)) .thenReturn(List.of(H... | @Override public List<HookPhase> getHookPhasesAfterStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_AFTER_STOP_IDLE, HookPhase.APPLICATION_AFTER_STOP_LIVE, context); hookPhases.add(HookPhase.AFTER_STOP); return hooksPhaseBuilder.buildHookPhases(hookPhases, context); } | StopAppStep extends SyncFlowableStepWithHooks implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesAfterStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_AFTER_STOP_IDLE, HookPhase.APPLICATION_AFTER_STOP_LIVE, co... | StopAppStep extends SyncFlowableStepWithHooks implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesAfterStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_AFTER_STOP_IDLE, HookPhase.APPLICATION_AFTER_STOP_LIVE, co... | StopAppStep extends SyncFlowableStepWithHooks implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesAfterStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_AFTER_STOP_IDLE, HookPhase.APPLICATION_AFTER_STOP_LIVE, co... | StopAppStep extends SyncFlowableStepWithHooks implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesAfterStep(ProcessContext context) { List<HookPhase> hookPhases = getHookPhases(HookPhase.APPLICATION_AFTER_STOP_IDLE, HookPhase.APPLICATION_AFTER_STOP_LIVE, co... |
@Test void testPollingErrorMessage() { context.setVariable(Variables.APP_TO_PROCESS, createCloudApplication("anatz")); String pollingErrorMessage = step.getPollingErrorMessage(context); Assertions.assertEquals("Error staging application \"anatz\"", pollingErrorMessage); } | @Override public String getPollingErrorMessage(ProcessContext context) { CloudApplication application = context.getVariable(Variables.APP_TO_PROCESS); return MessageFormat.format(Messages.ERROR_STAGING_APP_0, application.getName()); } | PollStageAppStatusExecution implements AsyncExecution { @Override public String getPollingErrorMessage(ProcessContext context) { CloudApplication application = context.getVariable(Variables.APP_TO_PROCESS); return MessageFormat.format(Messages.ERROR_STAGING_APP_0, application.getName()); } } | PollStageAppStatusExecution implements AsyncExecution { @Override public String getPollingErrorMessage(ProcessContext context) { CloudApplication application = context.getVariable(Variables.APP_TO_PROCESS); return MessageFormat.format(Messages.ERROR_STAGING_APP_0, application.getName()); } PollStageAppStatusExecution(R... | PollStageAppStatusExecution implements AsyncExecution { @Override public String getPollingErrorMessage(ProcessContext context) { CloudApplication application = context.getVariable(Variables.APP_TO_PROCESS); return MessageFormat.format(Messages.ERROR_STAGING_APP_0, application.getName()); } PollStageAppStatusExecution(R... | PollStageAppStatusExecution implements AsyncExecution { @Override public String getPollingErrorMessage(ProcessContext context) { CloudApplication application = context.getVariable(Variables.APP_TO_PROCESS); return MessageFormat.format(Messages.ERROR_STAGING_APP_0, application.getName()); } PollStageAppStatusExecution(R... |
@Test void testApplicationNotFoundExceptionThrown() { Mockito.doThrow(new CloudOperationException(HttpStatus.NOT_FOUND)) .when(client) .deleteApplication(anyString()); context.setVariable(Variables.APP_TO_PROCESS, createCloudApplication("test-app")); step.execute(execution); assertStepFinishedSuccessfully(); } | private void deleteApplication(CloudControllerClient client, String applicationName) { getStepLogger().info(Messages.DELETING_APP, applicationName); client.deleteApplication(applicationName); getStepLogger().debug(Messages.APP_DELETED, applicationName); } | DeleteApplicationStep extends UndeployAppStep { private void deleteApplication(CloudControllerClient client, String applicationName) { getStepLogger().info(Messages.DELETING_APP, applicationName); client.deleteApplication(applicationName); getStepLogger().debug(Messages.APP_DELETED, applicationName); } } | DeleteApplicationStep extends UndeployAppStep { private void deleteApplication(CloudControllerClient client, String applicationName) { getStepLogger().info(Messages.DELETING_APP, applicationName); client.deleteApplication(applicationName); getStepLogger().debug(Messages.APP_DELETED, applicationName); } } | DeleteApplicationStep extends UndeployAppStep { private void deleteApplication(CloudControllerClient client, String applicationName) { getStepLogger().info(Messages.DELETING_APP, applicationName); client.deleteApplication(applicationName); getStepLogger().debug(Messages.APP_DELETED, applicationName); } } | DeleteApplicationStep extends UndeployAppStep { private void deleteApplication(CloudControllerClient client, String applicationName) { getStepLogger().info(Messages.DELETING_APP, applicationName); client.deleteApplication(applicationName); getStepLogger().debug(Messages.APP_DELETED, applicationName); } } |
@Test void testBadGatewayExceptionThrown() { Mockito.doThrow(new CloudOperationException(HttpStatus.BAD_GATEWAY)) .when(client) .deleteApplication(anyString()); context.setVariable(Variables.APP_TO_PROCESS, createCloudApplication("test-app")); Assertions.assertThrows(SLException.class, () -> step.execute(execution)); } | private void deleteApplication(CloudControllerClient client, String applicationName) { getStepLogger().info(Messages.DELETING_APP, applicationName); client.deleteApplication(applicationName); getStepLogger().debug(Messages.APP_DELETED, applicationName); } | DeleteApplicationStep extends UndeployAppStep { private void deleteApplication(CloudControllerClient client, String applicationName) { getStepLogger().info(Messages.DELETING_APP, applicationName); client.deleteApplication(applicationName); getStepLogger().debug(Messages.APP_DELETED, applicationName); } } | DeleteApplicationStep extends UndeployAppStep { private void deleteApplication(CloudControllerClient client, String applicationName) { getStepLogger().info(Messages.DELETING_APP, applicationName); client.deleteApplication(applicationName); getStepLogger().debug(Messages.APP_DELETED, applicationName); } } | DeleteApplicationStep extends UndeployAppStep { private void deleteApplication(CloudControllerClient client, String applicationName) { getStepLogger().info(Messages.DELETING_APP, applicationName); client.deleteApplication(applicationName); getStepLogger().debug(Messages.APP_DELETED, applicationName); } } | DeleteApplicationStep extends UndeployAppStep { private void deleteApplication(CloudControllerClient client, String applicationName) { getStepLogger().info(Messages.DELETING_APP, applicationName); client.deleteApplication(applicationName); getStepLogger().debug(Messages.APP_DELETED, applicationName); } } |
@Test void testGetHookPhaseBefore() { Mockito.when(hooksPhaseBuilder.buildHookPhases(List.of(HookPhase.BEFORE_STOP, HookPhase.APPLICATION_BEFORE_STOP_LIVE), context)) .thenReturn(List.of(HookPhase.BLUE_GREEN_APPLICATION_BEFORE_STOP_LIVE, HookPhase.APPLICATION_BEFORE_STOP_LIVE)); List<HookPhase> expectedHooks = List.of(... | @Override public List<HookPhase> getHookPhasesBeforeStep(ProcessContext context) { return hooksPhaseBuilder.buildHookPhases(Arrays.asList(HookPhase.BEFORE_STOP, HookPhase.APPLICATION_BEFORE_STOP_LIVE), context); } | StopApplicationUndeploymentStep extends UndeployAppStep implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesBeforeStep(ProcessContext context) { return hooksPhaseBuilder.buildHookPhases(Arrays.asList(HookPhase.BEFORE_STOP, HookPhase.APPLICATION_BEFORE_STOP_... | StopApplicationUndeploymentStep extends UndeployAppStep implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesBeforeStep(ProcessContext context) { return hooksPhaseBuilder.buildHookPhases(Arrays.asList(HookPhase.BEFORE_STOP, HookPhase.APPLICATION_BEFORE_STOP_... | StopApplicationUndeploymentStep extends UndeployAppStep implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesBeforeStep(ProcessContext context) { return hooksPhaseBuilder.buildHookPhases(Arrays.asList(HookPhase.BEFORE_STOP, HookPhase.APPLICATION_BEFORE_STOP_... | StopApplicationUndeploymentStep extends UndeployAppStep implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesBeforeStep(ProcessContext context) { return hooksPhaseBuilder.buildHookPhases(Arrays.asList(HookPhase.BEFORE_STOP, HookPhase.APPLICATION_BEFORE_STOP_... |
@Test void rollbackWithNull() throws SQLException { JdbcUtil.rollback(null); } | public static void rollback(Connection connection) throws SQLException { if (connection == null) { return; } if (!connection.getAutoCommit()) { connection.rollback(); } } | JdbcUtil { public static void rollback(Connection connection) throws SQLException { if (connection == null) { return; } if (!connection.getAutoCommit()) { connection.rollback(); } } } | JdbcUtil { public static void rollback(Connection connection) throws SQLException { if (connection == null) { return; } if (!connection.getAutoCommit()) { connection.rollback(); } } private JdbcUtil(); } | JdbcUtil { public static void rollback(Connection connection) throws SQLException { if (connection == null) { return; } if (!connection.getAutoCommit()) { connection.rollback(); } } private JdbcUtil(); static void closeQuietly(ResultSet resultSet); static void closeQuietly(Statement statement); static void closeQuietl... | JdbcUtil { public static void rollback(Connection connection) throws SQLException { if (connection == null) { return; } if (!connection.getAutoCommit()) { connection.rollback(); } } private JdbcUtil(); static void closeQuietly(ResultSet resultSet); static void closeQuietly(Statement statement); static void closeQuietl... |
@Test void testGetHookPhaseAfter() { Mockito.when(hooksPhaseBuilder.buildHookPhases(List.of(HookPhase.AFTER_STOP, HookPhase.APPLICATION_AFTER_STOP_LIVE), context)) .thenReturn(List.of(HookPhase.BLUE_GREEN_APPLICATION_AFTER_STOP_LIVE, HookPhase.APPLICATION_AFTER_STOP_LIVE)); List<HookPhase> expectedHooks = List.of(HookP... | @Override public List<HookPhase> getHookPhasesAfterStep(ProcessContext context) { return hooksPhaseBuilder.buildHookPhases(Arrays.asList(HookPhase.AFTER_STOP, HookPhase.APPLICATION_AFTER_STOP_LIVE), context); } | StopApplicationUndeploymentStep extends UndeployAppStep implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesAfterStep(ProcessContext context) { return hooksPhaseBuilder.buildHookPhases(Arrays.asList(HookPhase.AFTER_STOP, HookPhase.APPLICATION_AFTER_STOP_LIV... | StopApplicationUndeploymentStep extends UndeployAppStep implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesAfterStep(ProcessContext context) { return hooksPhaseBuilder.buildHookPhases(Arrays.asList(HookPhase.AFTER_STOP, HookPhase.APPLICATION_AFTER_STOP_LIV... | StopApplicationUndeploymentStep extends UndeployAppStep implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesAfterStep(ProcessContext context) { return hooksPhaseBuilder.buildHookPhases(Arrays.asList(HookPhase.AFTER_STOP, HookPhase.APPLICATION_AFTER_STOP_LIV... | StopApplicationUndeploymentStep extends UndeployAppStep implements BeforeStepHookPhaseProvider, AfterStepHookPhaseProvider { @Override public List<HookPhase> getHookPhasesAfterStep(ProcessContext context) { return hooksPhaseBuilder.buildHookPhases(Arrays.asList(HookPhase.AFTER_STOP, HookPhase.APPLICATION_AFTER_STOP_LIV... |
@Test void testExecuteAdditionalAction() { retryProcessAdditionalAction.executeAdditionalProcessAction(PROCESS_GUID); Mockito.verify(progressMessageQuery, times(2)) .delete(); } | @Override public void executeAdditionalProcessAction(String processInstanceId) { List<String> failedActivityIds = findFailedActivityIds(processInstanceId); for (String failedActivityId : failedActivityIds) { progressMessageService.createQuery() .processId(processInstanceId) .taskId(failedActivityId) .type(ProgressMessa... | RetryProcessAdditionalAction implements AdditionalProcessAction { @Override public void executeAdditionalProcessAction(String processInstanceId) { List<String> failedActivityIds = findFailedActivityIds(processInstanceId); for (String failedActivityId : failedActivityIds) { progressMessageService.createQuery() .processI... | RetryProcessAdditionalAction implements AdditionalProcessAction { @Override public void executeAdditionalProcessAction(String processInstanceId) { List<String> failedActivityIds = findFailedActivityIds(processInstanceId); for (String failedActivityId : failedActivityIds) { progressMessageService.createQuery() .processI... | RetryProcessAdditionalAction implements AdditionalProcessAction { @Override public void executeAdditionalProcessAction(String processInstanceId) { List<String> failedActivityIds = findFailedActivityIds(processInstanceId); for (String failedActivityId : failedActivityIds) { progressMessageService.createQuery() .processI... | RetryProcessAdditionalAction implements AdditionalProcessAction { @Override public void executeAdditionalProcessAction(String processInstanceId) { List<String> failedActivityIds = findFailedActivityIds(processInstanceId); for (String failedActivityId : failedActivityIds) { progressMessageService.createQuery() .processI... |
@Test void testAsyncExecutorMethodsAreCalled() { flowableFacade.shutdownJobExecutor(); Mockito.verify(mockedAsyncExecutor, Mockito.times(1)) .shutdown(); } | public void shutdownJobExecutor() { LOGGER.info(Messages.SHUTTING_DOWN_FLOWABLE_JOB_EXECUTOR); AsyncExecutor asyncExecutor = processEngine.getProcessEngineConfiguration() .getAsyncExecutor(); asyncExecutor.shutdown(); } | FlowableFacade { public void shutdownJobExecutor() { LOGGER.info(Messages.SHUTTING_DOWN_FLOWABLE_JOB_EXECUTOR); AsyncExecutor asyncExecutor = processEngine.getProcessEngineConfiguration() .getAsyncExecutor(); asyncExecutor.shutdown(); } } | FlowableFacade { public void shutdownJobExecutor() { LOGGER.info(Messages.SHUTTING_DOWN_FLOWABLE_JOB_EXECUTOR); AsyncExecutor asyncExecutor = processEngine.getProcessEngineConfiguration() .getAsyncExecutor(); asyncExecutor.shutdown(); } @Inject FlowableFacade(ProcessEngine processEngine); } | FlowableFacade { public void shutdownJobExecutor() { LOGGER.info(Messages.SHUTTING_DOWN_FLOWABLE_JOB_EXECUTOR); AsyncExecutor asyncExecutor = processEngine.getProcessEngineConfiguration() .getAsyncExecutor(); asyncExecutor.shutdown(); } @Inject FlowableFacade(ProcessEngine processEngine); ProcessInstance startProcess(... | FlowableFacade { public void shutdownJobExecutor() { LOGGER.info(Messages.SHUTTING_DOWN_FLOWABLE_JOB_EXECUTOR); AsyncExecutor asyncExecutor = processEngine.getProcessEngineConfiguration() .getAsyncExecutor(); asyncExecutor.shutdown(); } @Inject FlowableFacade(ProcessEngine processEngine); ProcessInstance startProcess(... |
@Test void testExecuteAdditionalProcessAction() { setRetryPhaseAdditionalProcessAction.executeAdditionalProcessAction(PROCESS_GUID); Mockito.verify(runtimeService) .setVariable(EXECUTION_WITH_DEADLETTER_JOBS_PROCESS_ID, Variables.STEP_PHASE.getName(), StepPhase.RETRY.name()); Mockito.verify(runtimeService, never()) .se... | @Override public void executeAdditionalProcessAction(String processInstanceId) { flowableFacade.getActiveProcessExecutions(processInstanceId) .stream() .map(this::toExecutionEntityImpl) .filter(executionEntityImpl -> executionEntityImpl.getDeadLetterJobCount() > 0) .map(ExecutionEntityImpl::getProcessInstanceId) .forEa... | SetRetryPhaseAdditionalProcessAction implements AdditionalProcessAction { @Override public void executeAdditionalProcessAction(String processInstanceId) { flowableFacade.getActiveProcessExecutions(processInstanceId) .stream() .map(this::toExecutionEntityImpl) .filter(executionEntityImpl -> executionEntityImpl.getDeadLe... | SetRetryPhaseAdditionalProcessAction implements AdditionalProcessAction { @Override public void executeAdditionalProcessAction(String processInstanceId) { flowableFacade.getActiveProcessExecutions(processInstanceId) .stream() .map(this::toExecutionEntityImpl) .filter(executionEntityImpl -> executionEntityImpl.getDeadLe... | SetRetryPhaseAdditionalProcessAction implements AdditionalProcessAction { @Override public void executeAdditionalProcessAction(String processInstanceId) { flowableFacade.getActiveProcessExecutions(processInstanceId) .stream() .map(this::toExecutionEntityImpl) .filter(executionEntityImpl -> executionEntityImpl.getDeadLe... | SetRetryPhaseAdditionalProcessAction implements AdditionalProcessAction { @Override public void executeAdditionalProcessAction(String processInstanceId) { flowableFacade.getActiveProcessExecutions(processInstanceId) .stream() .map(this::toExecutionEntityImpl) .filter(executionEntityImpl -> executionEntityImpl.getDeadLe... |
@Test void testUpdateServicePlan1() { CloudControllerClient client = getMockedClient(); Mockito.when(client.getServiceInstance(EXISTING_SERVICE_INSTANCE_NAME)) .thenReturn(EXISTING_SERVICE_INSTANCE); serviceUpdater.updateServicePlan(client, EXISTING_SERVICE_INSTANCE_NAME, "v3.0-small"); validatePlanUpdate("8e886beb-85c... | public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } | ServiceUpdater extends CloudServiceOperator { public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } } | ServiceUpdater extends CloudServiceOperator { public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } @Inject... | ServiceUpdater extends CloudServiceOperator { public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } @Inject... | ServiceUpdater extends CloudServiceOperator { public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } @Inject... |
@Test void testUpdateServicePlan2() { CloudControllerClient client = getMockedClient(); Mockito.when(client.getServiceInstance(EXISTING_SERVICE_INSTANCE_NAME)) .thenReturn(EXISTING_SERVICE_INSTANCE); try { serviceUpdater.updateServicePlan(client, EXISTING_SERVICE_INSTANCE_NAME, "v3.0-large"); } catch (CloudOperationExc... | public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } | ServiceUpdater extends CloudServiceOperator { public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } } | ServiceUpdater extends CloudServiceOperator { public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } @Inject... | ServiceUpdater extends CloudServiceOperator { public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } @Inject... | ServiceUpdater extends CloudServiceOperator { public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } @Inject... |
@Test void testUpdateServicePlan3() { CloudControllerClient client = getMockedClient(); Mockito.when(client.getServiceInstance(EXISTING_SERVICE_INSTANCE_NAME)) .thenThrow(new CloudOperationException(HttpStatus.NOT_FOUND, HttpStatus.NOT_FOUND.getReasonPhrase(), "Service \"foo\" was not found!")); try { serviceUpdater.up... | public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } | ServiceUpdater extends CloudServiceOperator { public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } } | ServiceUpdater extends CloudServiceOperator { public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } @Inject... | ServiceUpdater extends CloudServiceOperator { public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } @Inject... | ServiceUpdater extends CloudServiceOperator { public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } @Inject... |
@Test void testGetRecentLogsWithError() { Mockito.when(client.getRecentLogs(APP_NAME)) .thenThrow(new HttpServerErrorException(HttpStatus.INTERNAL_SERVER_ERROR, "Something fails")); tester.test(() -> recentLogsRetriever.getRecentLogs(client, APP_NAME, null), new Expectation(Expectation.Type.EXCEPTION, "500 Something fa... | public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors.toList()); } | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... |
@Test void testGetRecentLogsWithNoPriorOffset() { Mockito.when(client.getRecentLogs(APP_NAME)) .thenReturn(List.of(createAppLog(1, ""))); assertEquals(List.of(createAppLog(1, "")), recentLogsRetriever.getRecentLogs(client, APP_NAME, null)); } | public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors.toList()); } | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... |
@Test void testGetRecentLogsWithOffsetReturnsNoLogs() { LogsOffset offset = createLogsOffset(1, ""); Mockito.when(client.getRecentLogs(APP_NAME)) .thenReturn(List.of(createAppLog(0, ""))); assertTrue(recentLogsRetriever.getRecentLogs(client, APP_NAME, offset) .isEmpty()); } | public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors.toList()); } | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... |
@Test void rollbackWithAutoCommit() throws SQLException { Connection connection = Mockito.mock(Connection.class); Mockito.when(connection.getAutoCommit()) .thenReturn(true); JdbcUtil.rollback(connection); Mockito.verify(connection, Mockito.never()) .rollback(); } | public static void rollback(Connection connection) throws SQLException { if (connection == null) { return; } if (!connection.getAutoCommit()) { connection.rollback(); } } | JdbcUtil { public static void rollback(Connection connection) throws SQLException { if (connection == null) { return; } if (!connection.getAutoCommit()) { connection.rollback(); } } } | JdbcUtil { public static void rollback(Connection connection) throws SQLException { if (connection == null) { return; } if (!connection.getAutoCommit()) { connection.rollback(); } } private JdbcUtil(); } | JdbcUtil { public static void rollback(Connection connection) throws SQLException { if (connection == null) { return; } if (!connection.getAutoCommit()) { connection.rollback(); } } private JdbcUtil(); static void closeQuietly(ResultSet resultSet); static void closeQuietly(Statement statement); static void closeQuietl... | JdbcUtil { public static void rollback(Connection connection) throws SQLException { if (connection == null) { return; } if (!connection.getAutoCommit()) { connection.rollback(); } } private JdbcUtil(); static void closeQuietly(ResultSet resultSet); static void closeQuietly(Statement statement); static void closeQuietl... |
@Test void testGetRecentLogsWithOffsetSameMessageReturnsNoLogs() { LogsOffset offset = createLogsOffset(1, "msg"); Mockito.when(client.getRecentLogs(APP_NAME)) .thenReturn(List.of(createAppLog(1, "msg"))); assertTrue(recentLogsRetriever.getRecentLogs(client, APP_NAME, offset) .isEmpty()); } | public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors.toList()); } | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... |
@Test void testGetRecentLogsWithOffsetReturnsFilteredLogs() { LogsOffset offset = createLogsOffset(1, ""); Mockito.when(client.getRecentLogs(APP_NAME)) .thenReturn(List.of(createAppLog(1, ""), createAppLog(2, ""))); assertEquals(List.of(createAppLog(2, "")), recentLogsRetriever.getRecentLogs(client, APP_NAME, offset));... | public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors.toList()); } | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... |
@Test void testGetRecentLogsWithOffsetSameTimestampReturnsFilteredLogs() { LogsOffset offset = createLogsOffset(1, "msg"); Mockito.when(client.getRecentLogs(APP_NAME)) .thenReturn(List.of(createAppLog(1, "msg"), createAppLog(1, "msg1"))); assertEquals(List.of(createAppLog(1, "msg1")), recentLogsRetriever.getRecentLogs(... | public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors.toList()); } | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... |
@Test void testGetRecentLogsWithOffsetSameMessageReturnsFilteredLogs() { LogsOffset offset = createLogsOffset(1, "msg1"); Mockito.when(client.getRecentLogs(APP_NAME)) .thenReturn(List.of(createAppLog(1, "msg"), createAppLog(1, "msg1"))); assertEquals(List.of(createAppLog(1, "msg")), recentLogsRetriever.getRecentLogs(cl... | public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors.toList()); } | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... | RecentLogsRetriever { public List<ApplicationLog> getRecentLogs(CloudControllerClient client, String appName, LogsOffset offset) { List<ApplicationLog> appLogs = client.getRecentLogs(appName); if (offset == null) { return appLogs; } return appLogs.stream() .filter(appLog -> isLogNew(appLog, offset)) .collect(Collectors... |
@Test void testInjectOnlyDeployServiceVersion() throws IOException { TaggingRequestFilterFunction testedFilterFunction = new TaggingRequestFilterFunction(TEST_VERSION_VALUE); testedFilterFunction.filter(clientRequest, nextFilter); assertEquals("MTA deploy-service v1.58.0", actualHeaders.getFirst(TaggingRequestFilterFun... | @Override public Mono<ClientResponse> filter(ClientRequest clientRequest, ExchangeFunction nextFilter) { HttpHeaders headers = clientRequest.headers(); setHeader(headers, TAG_HEADER_NAME, headerValue); if (orgHeaderValue != null && spaceHeaderValue != null) { setHeader(headers, TAG_HEADER_ORG_NAME, orgHeaderValue); set... | TaggingRequestFilterFunction implements ExchangeFilterFunction { @Override public Mono<ClientResponse> filter(ClientRequest clientRequest, ExchangeFunction nextFilter) { HttpHeaders headers = clientRequest.headers(); setHeader(headers, TAG_HEADER_NAME, headerValue); if (orgHeaderValue != null && spaceHeaderValue != nul... | TaggingRequestFilterFunction implements ExchangeFilterFunction { @Override public Mono<ClientResponse> filter(ClientRequest clientRequest, ExchangeFunction nextFilter) { HttpHeaders headers = clientRequest.headers(); setHeader(headers, TAG_HEADER_NAME, headerValue); if (orgHeaderValue != null && spaceHeaderValue != nul... | TaggingRequestFilterFunction implements ExchangeFilterFunction { @Override public Mono<ClientResponse> filter(ClientRequest clientRequest, ExchangeFunction nextFilter) { HttpHeaders headers = clientRequest.headers(); setHeader(headers, TAG_HEADER_NAME, headerValue); if (orgHeaderValue != null && spaceHeaderValue != nul... | TaggingRequestFilterFunction implements ExchangeFilterFunction { @Override public Mono<ClientResponse> filter(ClientRequest clientRequest, ExchangeFunction nextFilter) { HttpHeaders headers = clientRequest.headers(); setHeader(headers, TAG_HEADER_NAME, headerValue); if (orgHeaderValue != null && spaceHeaderValue != nul... |
@Test void testInjectOrgAndSpaceValues() throws IOException { TaggingRequestFilterFunction testedFilterFunction = new TaggingRequestFilterFunction(TEST_VERSION_VALUE, TEST_ORG_VALUE, TEST_SPACE_VALUE); testedFilterFunction.filter(clientRequest, nextFilter); assertEquals("MTA deploy-service v1.58.0", actualHeaders.getFi... | @Override public Mono<ClientResponse> filter(ClientRequest clientRequest, ExchangeFunction nextFilter) { HttpHeaders headers = clientRequest.headers(); setHeader(headers, TAG_HEADER_NAME, headerValue); if (orgHeaderValue != null && spaceHeaderValue != null) { setHeader(headers, TAG_HEADER_ORG_NAME, orgHeaderValue); set... | TaggingRequestFilterFunction implements ExchangeFilterFunction { @Override public Mono<ClientResponse> filter(ClientRequest clientRequest, ExchangeFunction nextFilter) { HttpHeaders headers = clientRequest.headers(); setHeader(headers, TAG_HEADER_NAME, headerValue); if (orgHeaderValue != null && spaceHeaderValue != nul... | TaggingRequestFilterFunction implements ExchangeFilterFunction { @Override public Mono<ClientResponse> filter(ClientRequest clientRequest, ExchangeFunction nextFilter) { HttpHeaders headers = clientRequest.headers(); setHeader(headers, TAG_HEADER_NAME, headerValue); if (orgHeaderValue != null && spaceHeaderValue != nul... | TaggingRequestFilterFunction implements ExchangeFilterFunction { @Override public Mono<ClientResponse> filter(ClientRequest clientRequest, ExchangeFunction nextFilter) { HttpHeaders headers = clientRequest.headers(); setHeader(headers, TAG_HEADER_NAME, headerValue); if (orgHeaderValue != null && spaceHeaderValue != nul... | TaggingRequestFilterFunction implements ExchangeFilterFunction { @Override public Mono<ClientResponse> filter(ClientRequest clientRequest, ExchangeFunction nextFilter) { HttpHeaders headers = clientRequest.headers(); setHeader(headers, TAG_HEADER_NAME, headerValue); if (orgHeaderValue != null && spaceHeaderValue != nul... |
@Test void testGetAllVariables() { Map<String, String> variables = new HashMap<>(); variables.put("foo", "bar"); variables.put("baz", "qux"); Mockito.when(environmentVariablesAccessor.getAllVariables()) .thenReturn(variables); assertEquals(variables, environment.getAllVariables()); } | public Map<String, String> getAllVariables() { return environmentVariablesAccessor.getAllVariables(); } | Environment { public Map<String, String> getAllVariables() { return environmentVariablesAccessor.getAllVariables(); } } | Environment { public Map<String, String> getAllVariables() { return environmentVariablesAccessor.getAllVariables(); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public Map<String, String> getAllVariables() { return environmentVariablesAccessor.getAllVariables(); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getIntege... | Environment { public Map<String, String> getAllVariables() { return environmentVariablesAccessor.getAllVariables(); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getIntege... |
@Test void testGetString() { Mockito.when(environmentVariablesAccessor.getVariable("ab")) .thenReturn("cd"); assertEquals("cd", environment.getString("ab")); } | public String getString(String name) { return getString(name, null); } | Environment { public String getString(String name) { return getString(name, null); } } | Environment { public String getString(String name) { return getString(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public String getString(String name) { return getString(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoolea... | Environment { public String getString(String name) { return getString(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoolea... |
@Test void testGetStringWhenVariableIsMissing() { assertNull(environment.getString("ab")); } | public String getString(String name) { return getString(name, null); } | Environment { public String getString(String name) { return getString(name, null); } } | Environment { public String getString(String name) { return getString(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public String getString(String name) { return getString(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoolea... | Environment { public String getString(String name) { return getString(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoolea... |
@Test void testGetStringWithDefault() { assertEquals("cd", environment.getString("ab", "cd")); } | public String getString(String name) { return getString(name, null); } | Environment { public String getString(String name) { return getString(name, null); } } | Environment { public String getString(String name) { return getString(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public String getString(String name) { return getString(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoolea... | Environment { public String getString(String name) { return getString(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoolea... |
@Test void commit() throws SQLException { Connection connection = Mockito.mock(Connection.class); Mockito.when(connection.getAutoCommit()) .thenReturn(false); JdbcUtil.commit(connection); Mockito.verify(connection) .commit(); } | public static void commit(Connection connection) throws SQLException { if (!connection.getAutoCommit()) { connection.commit(); } } | JdbcUtil { public static void commit(Connection connection) throws SQLException { if (!connection.getAutoCommit()) { connection.commit(); } } } | JdbcUtil { public static void commit(Connection connection) throws SQLException { if (!connection.getAutoCommit()) { connection.commit(); } } private JdbcUtil(); } | JdbcUtil { public static void commit(Connection connection) throws SQLException { if (!connection.getAutoCommit()) { connection.commit(); } } private JdbcUtil(); static void closeQuietly(ResultSet resultSet); static void closeQuietly(Statement statement); static void closeQuietly(Connection connection); static void lo... | JdbcUtil { public static void commit(Connection connection) throws SQLException { if (!connection.getAutoCommit()) { connection.commit(); } } private JdbcUtil(); static void closeQuietly(ResultSet resultSet); static void closeQuietly(Statement statement); static void closeQuietly(Connection connection); static void lo... |
@Test void testGetLong() { Mockito.when(environmentVariablesAccessor.getVariable("ab")) .thenReturn("12"); assertEquals(12, (long) environment.getLong("ab")); } | public Long getLong(String name) { return getLong(name, null); } | Environment { public Long getLong(String name) { return getLong(name, null); } } | Environment { public Long getLong(String name) { return getLong(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public Long getLong(String name) { return getLong(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoolean(Stri... | Environment { public Long getLong(String name) { return getLong(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoolean(Stri... |
@Test void testGetLongWhenVariableIsMissing() { assertNull(environment.getLong("ab")); } | public Long getLong(String name) { return getLong(name, null); } | Environment { public Long getLong(String name) { return getLong(name, null); } } | Environment { public Long getLong(String name) { return getLong(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public Long getLong(String name) { return getLong(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoolean(Stri... | Environment { public Long getLong(String name) { return getLong(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoolean(Stri... |
@Test void testGetLongWithDefault() { assertEquals(12, (long) environment.getLong("ab", 12L)); } | public Long getLong(String name) { return getLong(name, null); } | Environment { public Long getLong(String name) { return getLong(name, null); } } | Environment { public Long getLong(String name) { return getLong(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public Long getLong(String name) { return getLong(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoolean(Stri... | Environment { public Long getLong(String name) { return getLong(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoolean(Stri... |
@Test void testGetInteger() { Mockito.when(environmentVariablesAccessor.getVariable("ab")) .thenReturn("12"); assertEquals(12, (long) environment.getInteger("ab")); } | public Integer getInteger(String name) { return getInteger(name, null); } | Environment { public Integer getInteger(String name) { return getInteger(name, null); } } | Environment { public Integer getInteger(String name) { return getInteger(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public Integer getInteger(String name) { return getInteger(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoo... | Environment { public Integer getInteger(String name) { return getInteger(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoo... |
@Test void testGetIntegerWhenVariableIsMissing() { assertNull(environment.getInteger("ab")); } | public Integer getInteger(String name) { return getInteger(name, null); } | Environment { public Integer getInteger(String name) { return getInteger(name, null); } } | Environment { public Integer getInteger(String name) { return getInteger(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public Integer getInteger(String name) { return getInteger(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoo... | Environment { public Integer getInteger(String name) { return getInteger(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoo... |
@Test void testGetIntegerWithDefault() { assertEquals(12, (int) environment.getInteger("ab", 12)); } | public Integer getInteger(String name) { return getInteger(name, null); } | Environment { public Integer getInteger(String name) { return getInteger(name, null); } } | Environment { public Integer getInteger(String name) { return getInteger(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public Integer getInteger(String name) { return getInteger(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoo... | Environment { public Integer getInteger(String name) { return getInteger(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoo... |
@Test void testGetBoolean() { Mockito.when(environmentVariablesAccessor.getVariable("ab")) .thenReturn("false"); assertEquals(false, environment.getBoolean("ab")); } | public Boolean getBoolean(String name) { return getBoolean(name, null); } | Environment { public Boolean getBoolean(String name) { return getBoolean(name, null); } } | Environment { public Boolean getBoolean(String name) { return getBoolean(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public Boolean getBoolean(String name) { return getBoolean(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoo... | Environment { public Boolean getBoolean(String name) { return getBoolean(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoo... |
@Test void testGetBooleanWhenVariableIsMissing() { assertNull(environment.getBoolean("ab")); } | public Boolean getBoolean(String name) { return getBoolean(name, null); } | Environment { public Boolean getBoolean(String name) { return getBoolean(name, null); } } | Environment { public Boolean getBoolean(String name) { return getBoolean(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public Boolean getBoolean(String name) { return getBoolean(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoo... | Environment { public Boolean getBoolean(String name) { return getBoolean(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoo... |
@Test void testGetBooleanWithDefault() { assertEquals(false, environment.getBoolean("ab", false)); } | public Boolean getBoolean(String name) { return getBoolean(name, null); } | Environment { public Boolean getBoolean(String name) { return getBoolean(name, null); } } | Environment { public Boolean getBoolean(String name) { return getBoolean(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public Boolean getBoolean(String name) { return getBoolean(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoo... | Environment { public Boolean getBoolean(String name) { return getBoolean(name, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name); Boolean getBoo... |
@Test void testGetPositiveIntegerWithNull() { assertEquals(Integer.MAX_VALUE, (int) environment.getPositiveInteger("ab", null)); } | public Integer getPositiveInteger(String name, Integer defaultValue) { Integer value = getInteger(name, defaultValue); if (value == null || value <= 0) { value = Integer.MAX_VALUE; } return value; } | Environment { public Integer getPositiveInteger(String name, Integer defaultValue) { Integer value = getInteger(name, defaultValue); if (value == null || value <= 0) { value = Integer.MAX_VALUE; } return value; } } | Environment { public Integer getPositiveInteger(String name, Integer defaultValue) { Integer value = getInteger(name, defaultValue); if (value == null || value <= 0) { value = Integer.MAX_VALUE; } return value; } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public Integer getPositiveInteger(String name, Integer defaultValue) { Integer value = getInteger(name, defaultValue); if (value == null || value <= 0) { value = Integer.MAX_VALUE; } return value; } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String>... | Environment { public Integer getPositiveInteger(String name, Integer defaultValue) { Integer value = getInteger(name, defaultValue); if (value == null || value <= 0) { value = Integer.MAX_VALUE; } return value; } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String>... |
@Test void commitWithAutoCommit() throws SQLException { Connection connection = Mockito.mock(Connection.class); Mockito.when(connection.getAutoCommit()) .thenReturn(true); JdbcUtil.commit(connection); Mockito.verify(connection, Mockito.never()) .commit(); } | public static void commit(Connection connection) throws SQLException { if (!connection.getAutoCommit()) { connection.commit(); } } | JdbcUtil { public static void commit(Connection connection) throws SQLException { if (!connection.getAutoCommit()) { connection.commit(); } } } | JdbcUtil { public static void commit(Connection connection) throws SQLException { if (!connection.getAutoCommit()) { connection.commit(); } } private JdbcUtil(); } | JdbcUtil { public static void commit(Connection connection) throws SQLException { if (!connection.getAutoCommit()) { connection.commit(); } } private JdbcUtil(); static void closeQuietly(ResultSet resultSet); static void closeQuietly(Statement statement); static void closeQuietly(Connection connection); static void lo... | JdbcUtil { public static void commit(Connection connection) throws SQLException { if (!connection.getAutoCommit()) { connection.commit(); } } private JdbcUtil(); static void closeQuietly(ResultSet resultSet); static void closeQuietly(Statement statement); static void closeQuietly(Connection connection); static void lo... |
@Test void testGetNegativeIntegerWithNull() { assertEquals(Integer.MIN_VALUE, (int) environment.getNegativeInteger("ab", null)); } | public Integer getNegativeInteger(String name, Integer defaultValue) { Integer value = getInteger(name, defaultValue); if (value == null || value >= 0) { value = Integer.MIN_VALUE; } return value; } | Environment { public Integer getNegativeInteger(String name, Integer defaultValue) { Integer value = getInteger(name, defaultValue); if (value == null || value >= 0) { value = Integer.MIN_VALUE; } return value; } } | Environment { public Integer getNegativeInteger(String name, Integer defaultValue) { Integer value = getInteger(name, defaultValue); if (value == null || value >= 0) { value = Integer.MIN_VALUE; } return value; } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public Integer getNegativeInteger(String name, Integer defaultValue) { Integer value = getInteger(name, defaultValue); if (value == null || value >= 0) { value = Integer.MIN_VALUE; } return value; } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String>... | Environment { public Integer getNegativeInteger(String name, Integer defaultValue) { Integer value = getInteger(name, defaultValue); if (value == null || value >= 0) { value = Integer.MIN_VALUE; } return value; } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String>... |
@Test void tetGetVariable() { UUID expectedUuid = UUID.fromString("c9fbfbfd-8d54-4cba-958f-25a3f7a14ca7"); Mockito.when(environmentVariablesAccessor.getVariable("ab")) .thenReturn(expectedUuid.toString()); assertEquals(expectedUuid, environment.getVariable("ab", UUID::fromString)); } | public <T> T getVariable(String name, Function<String, T> mappingFunction) { return getVariable(name, mappingFunction, null); } | Environment { public <T> T getVariable(String name, Function<String, T> mappingFunction) { return getVariable(name, mappingFunction, null); } } | Environment { public <T> T getVariable(String name, Function<String, T> mappingFunction) { return getVariable(name, mappingFunction, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public <T> T getVariable(String name, Function<String, T> mappingFunction) { return getVariable(name, mappingFunction, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String ... | Environment { public <T> T getVariable(String name, Function<String, T> mappingFunction) { return getVariable(name, mappingFunction, null); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String ... |
@Test void testHasVariable() { Mockito.when(environmentVariablesAccessor.getVariable("ab")) .thenReturn("0"); assertTrue(environment.hasVariable("ab")); } | public boolean hasVariable(String name) { return !StringUtils.isEmpty(getString(name)); } | Environment { public boolean hasVariable(String name) { return !StringUtils.isEmpty(getString(name)); } } | Environment { public boolean hasVariable(String name) { return !StringUtils.isEmpty(getString(name)); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public boolean hasVariable(String name) { return !StringUtils.isEmpty(getString(name)); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name)... | Environment { public boolean hasVariable(String name) { return !StringUtils.isEmpty(getString(name)); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name)... |
@Test void testHasVariableWhenVariableIsMissing() { assertFalse(environment.hasVariable("ab")); } | public boolean hasVariable(String name) { return !StringUtils.isEmpty(getString(name)); } | Environment { public boolean hasVariable(String name) { return !StringUtils.isEmpty(getString(name)); } } | Environment { public boolean hasVariable(String name) { return !StringUtils.isEmpty(getString(name)); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); } | Environment { public boolean hasVariable(String name) { return !StringUtils.isEmpty(getString(name)); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name)... | Environment { public boolean hasVariable(String name) { return !StringUtils.isEmpty(getString(name)); } Environment(); Environment(EnvironmentVariablesAccessor environmentVariablesAccessor); Map<String, String> getAllVariables(); Long getLong(String name); String getString(String name); Integer getInteger(String name)... |
@Test void testExecuteRequestWithNoProtectionNeeded() throws IOException { HttpClient httpClient = HttpMocks.mockClient(builder -> builder.addResponse(OK_RESPONSE)); HttpRequest request = Mockito.spy(new HttpGet()); HttpResponse response = getResultFromExecution(httpClient, client -> client.execute(null, request)); Moc... | @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); @Override HttpPar... | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); @Override HttpPar... |
@Test void testExecuteSimpleRequestWithNoRetryShouldReturnTheResponse() throws IOException { HttpClient httpClient = HttpMocks.mockClient(builder -> builder.addResponse(OK_RESPONSE_WITH_FOO_TOKEN)); HttpRequest request = Mockito.spy(new HttpPost()); HttpResponse response = getResultFromExecution(httpClient, "dummy", cl... | @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); @Override HttpPar... | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); @Override HttpPar... |
@Test void testExecuteSimpleRequestWithRetryNeeded() throws IOException { HttpClient httpClient = HttpMocks.mockClient(builder -> builder.addResponse(OK_RESPONSE_WITH_FOO_TOKEN) .addResponse(FORBIDDEN_RESPONSE) .addResponse(OK_RESPONSE_WITH_BAR_TOKEN)); HttpRequest request = Mockito.spy(new HttpPost()); HttpResponse re... | @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); @Override HttpPar... | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); @Override HttpPar... |
@Test void testExecuteWithContext() throws IOException { HttpClient httpClient = HttpMocks.mockClient(builder -> builder.addResponse(OK_RESPONSE)); HttpRequest request = Mockito.spy(new HttpGet()); HttpResponse response = getResultFromExecution(httpClient, "dummy", client -> client.execute(null, request, (HttpContext) ... | @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); @Override HttpPar... | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); @Override HttpPar... |
@Test void testExecuteWithTarget() throws IOException { HttpClient httpClient = HttpMocks.mockClient(builder -> builder.addResponse(OK_RESPONSE)); HttpRequest request = Mockito.spy(new HttpGet()); HttpResponse response = getResultFromExecution(httpClient, "dummy", client -> client.execute(null, request, (HttpContext) n... | @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); @Override HttpPar... | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); @Override HttpPar... |
@Test void testExecuteWithResponseHandler() throws IOException { HttpClient httpClient = HttpMocks.mockClient(builder -> builder.addResponse(OK_RESPONSE) .responseHandlerReturnValue(RESPONSE_HANDLER_RETURN_VALUE)); HttpRequest request = Mockito.spy(new HttpGet()); String result = getResultFromExecution(httpClient, clie... | @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); @Override HttpPar... | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); @Override HttpPar... |
@Test void testGetLogger() { prepareContext(); processLogger = processLoggerProvider.getLogger(execution); assertEquals(CORRELATION_ID, processLogger.getProcessId()); assertEquals(TASK_ID, processLogger.getActivityId()); assertEquals(SPACE_ID, processLogger.spaceId); } | public ProcessLogger getLogger(DelegateExecution execution) { return getLogger(execution, DEFAULT_LOG_NAME); } | ProcessLoggerProvider { public ProcessLogger getLogger(DelegateExecution execution) { return getLogger(execution, DEFAULT_LOG_NAME); } } | ProcessLoggerProvider { public ProcessLogger getLogger(DelegateExecution execution) { return getLogger(execution, DEFAULT_LOG_NAME); } } | ProcessLoggerProvider { public ProcessLogger getLogger(DelegateExecution execution) { return getLogger(execution, DEFAULT_LOG_NAME); } ProcessLogger getLogger(DelegateExecution execution); ProcessLogger getLogger(DelegateExecution execution, String logName); ProcessLogger getLogger(DelegateExecution execution, String ... | ProcessLoggerProvider { public ProcessLogger getLogger(DelegateExecution execution) { return getLogger(execution, DEFAULT_LOG_NAME); } ProcessLogger getLogger(DelegateExecution execution); ProcessLogger getLogger(DelegateExecution execution, String logName); ProcessLogger getLogger(DelegateExecution execution, String ... |
@Test void testWithNoUrlSet() throws IOException { HttpClient httpClient = HttpMocks.mockClient(builder -> builder.addResponse(OK_RESPONSE)); HttpRequest request = Mockito.spy(new HttpPost()); HttpResponse response = getResultFromExecution(httpClient, client -> client.execute(null, request)); Assertions.assertNotNull(r... | @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); } | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); @Override HttpPar... | CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); @Override HttpPar... |
@Test void testWithoutExceptions() { SafeExecutor safeExecutor = new SafeExecutor(exceptionHandler); safeExecutor.execute(() -> { }); Mockito.verifyNoInteractions(exceptionHandler); } | public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } | SafeExecutor { public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } } | SafeExecutor { public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } SafeExecutor(); SafeExecutor(Consumer<Exception> exceptionHandler); } | SafeExecutor { public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } SafeExecutor(); SafeExecutor(Consumer<Exception> exceptionHandler); void execute(FailableRunnable<E> runnable); } | SafeExecutor { public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } SafeExecutor(); SafeExecutor(Consumer<Exception> exceptionHandler); void execute(FailableRunnable<E> runnable); } |
@Test void testWithException() { SafeExecutor safeExecutor = new SafeExecutor(exceptionHandler); Exception e = new Exception(); safeExecutor.execute(() -> { throw e; }); Mockito.verify(exceptionHandler) .accept(e); } | public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } | SafeExecutor { public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } } | SafeExecutor { public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } SafeExecutor(); SafeExecutor(Consumer<Exception> exceptionHandler); } | SafeExecutor { public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } SafeExecutor(); SafeExecutor(Consumer<Exception> exceptionHandler); void execute(FailableRunnable<E> runnable); } | SafeExecutor { public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } SafeExecutor(); SafeExecutor(Consumer<Exception> exceptionHandler); void execute(FailableRunnable<E> runnable); } |
@Test void testWithDefaultExceptionHandler() { SafeExecutor safeExecutor = new SafeExecutor(); Exception e = new Exception(); Assertions.assertDoesNotThrow(() -> safeExecutor.execute(() -> { throw e; })); } | public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } | SafeExecutor { public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } } | SafeExecutor { public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } SafeExecutor(); SafeExecutor(Consumer<Exception> exceptionHandler); } | SafeExecutor { public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } SafeExecutor(); SafeExecutor(Consumer<Exception> exceptionHandler); void execute(FailableRunnable<E> runnable); } | SafeExecutor { public <E extends Exception> void execute(FailableRunnable<E> runnable) { try { runnable.run(); } catch (Exception e) { exceptionHandler.accept(e); } } SafeExecutor(); SafeExecutor(Consumer<Exception> exceptionHandler); void execute(FailableRunnable<E> runnable); } |
@Test void testFindRouteWithHostBasedUriWithPort() { List<CloudRoute> routes = List.of(route); Assertions.assertThrows(NotFoundException.class, () -> UriUtil.findRoute(routes, HOST_BASED_URI_WITH_PORT)); } | public static CloudRoute findRoute(List<CloudRoute> routes, String uri) { return routes.stream() .filter(route -> routeMatchesUri(route, uri)) .findAny() .orElseThrow(() -> new NotFoundException(Messages.ROUTE_NOT_FOUND, uri)); } | UriUtil { public static CloudRoute findRoute(List<CloudRoute> routes, String uri) { return routes.stream() .filter(route -> routeMatchesUri(route, uri)) .findAny() .orElseThrow(() -> new NotFoundException(Messages.ROUTE_NOT_FOUND, uri)); } } | UriUtil { public static CloudRoute findRoute(List<CloudRoute> routes, String uri) { return routes.stream() .filter(route -> routeMatchesUri(route, uri)) .findAny() .orElseThrow(() -> new NotFoundException(Messages.ROUTE_NOT_FOUND, uri)); } private UriUtil(); } | UriUtil { public static CloudRoute findRoute(List<CloudRoute> routes, String uri) { return routes.stream() .filter(route -> routeMatchesUri(route, uri)) .findAny() .orElseThrow(() -> new NotFoundException(Messages.ROUTE_NOT_FOUND, uri)); } private UriUtil(); static String stripScheme(String uri); static CloudRoute fin... | UriUtil { public static CloudRoute findRoute(List<CloudRoute> routes, String uri) { return routes.stream() .filter(route -> routeMatchesUri(route, uri)) .findAny() .orElseThrow(() -> new NotFoundException(Messages.ROUTE_NOT_FOUND, uri)); } private UriUtil(); static String stripScheme(String uri); static CloudRoute fin... |
@Test void testFindRouteWithHostBasedUriWithoutPort() { List<CloudRoute> routes = List.of(route); CloudRoute actualResult = UriUtil.findRoute(routes, HOST_BASED_URI_WITHOUT_PORT); Assertions.assertEquals(route, actualResult); } | public static CloudRoute findRoute(List<CloudRoute> routes, String uri) { return routes.stream() .filter(route -> routeMatchesUri(route, uri)) .findAny() .orElseThrow(() -> new NotFoundException(Messages.ROUTE_NOT_FOUND, uri)); } | UriUtil { public static CloudRoute findRoute(List<CloudRoute> routes, String uri) { return routes.stream() .filter(route -> routeMatchesUri(route, uri)) .findAny() .orElseThrow(() -> new NotFoundException(Messages.ROUTE_NOT_FOUND, uri)); } } | UriUtil { public static CloudRoute findRoute(List<CloudRoute> routes, String uri) { return routes.stream() .filter(route -> routeMatchesUri(route, uri)) .findAny() .orElseThrow(() -> new NotFoundException(Messages.ROUTE_NOT_FOUND, uri)); } private UriUtil(); } | UriUtil { public static CloudRoute findRoute(List<CloudRoute> routes, String uri) { return routes.stream() .filter(route -> routeMatchesUri(route, uri)) .findAny() .orElseThrow(() -> new NotFoundException(Messages.ROUTE_NOT_FOUND, uri)); } private UriUtil(); static String stripScheme(String uri); static CloudRoute fin... | UriUtil { public static CloudRoute findRoute(List<CloudRoute> routes, String uri) { return routes.stream() .filter(route -> routeMatchesUri(route, uri)) .findAny() .orElseThrow(() -> new NotFoundException(Messages.ROUTE_NOT_FOUND, uri)); } private UriUtil(); static String stripScheme(String uri); static CloudRoute fin... |
@Test void testFindRouteWithPortBasedUri() { List<CloudRoute> routes = List.of(route); Assertions.assertThrows(NotFoundException.class, () -> UriUtil.findRoute(routes, PORT_BASED_URI)); } | public static CloudRoute findRoute(List<CloudRoute> routes, String uri) { return routes.stream() .filter(route -> routeMatchesUri(route, uri)) .findAny() .orElseThrow(() -> new NotFoundException(Messages.ROUTE_NOT_FOUND, uri)); } | UriUtil { public static CloudRoute findRoute(List<CloudRoute> routes, String uri) { return routes.stream() .filter(route -> routeMatchesUri(route, uri)) .findAny() .orElseThrow(() -> new NotFoundException(Messages.ROUTE_NOT_FOUND, uri)); } } | UriUtil { public static CloudRoute findRoute(List<CloudRoute> routes, String uri) { return routes.stream() .filter(route -> routeMatchesUri(route, uri)) .findAny() .orElseThrow(() -> new NotFoundException(Messages.ROUTE_NOT_FOUND, uri)); } private UriUtil(); } | UriUtil { public static CloudRoute findRoute(List<CloudRoute> routes, String uri) { return routes.stream() .filter(route -> routeMatchesUri(route, uri)) .findAny() .orElseThrow(() -> new NotFoundException(Messages.ROUTE_NOT_FOUND, uri)); } private UriUtil(); static String stripScheme(String uri); static CloudRoute fin... | UriUtil { public static CloudRoute findRoute(List<CloudRoute> routes, String uri) { return routes.stream() .filter(route -> routeMatchesUri(route, uri)) .findAny() .orElseThrow(() -> new NotFoundException(Messages.ROUTE_NOT_FOUND, uri)); } private UriUtil(); static String stripScheme(String uri); static CloudRoute fin... |
@Test void testRouteMatchesWithHostBasedUriWithPort() { boolean actualResult = UriUtil.routeMatchesUri(route, HOST_BASED_URI_WITH_PORT); Assertions.assertFalse(actualResult); } | public static boolean routeMatchesUri(CloudRoute route, String uri) { ApplicationURI appUriFromRoute = new ApplicationURI(route); ApplicationURI appUriFromString = new ApplicationURI(uri); return appUriFromRoute.equals(appUriFromString); } | UriUtil { public static boolean routeMatchesUri(CloudRoute route, String uri) { ApplicationURI appUriFromRoute = new ApplicationURI(route); ApplicationURI appUriFromString = new ApplicationURI(uri); return appUriFromRoute.equals(appUriFromString); } } | UriUtil { public static boolean routeMatchesUri(CloudRoute route, String uri) { ApplicationURI appUriFromRoute = new ApplicationURI(route); ApplicationURI appUriFromString = new ApplicationURI(uri); return appUriFromRoute.equals(appUriFromString); } private UriUtil(); } | UriUtil { public static boolean routeMatchesUri(CloudRoute route, String uri) { ApplicationURI appUriFromRoute = new ApplicationURI(route); ApplicationURI appUriFromString = new ApplicationURI(uri); return appUriFromRoute.equals(appUriFromString); } private UriUtil(); static String stripScheme(String uri); static Clou... | UriUtil { public static boolean routeMatchesUri(CloudRoute route, String uri) { ApplicationURI appUriFromRoute = new ApplicationURI(route); ApplicationURI appUriFromString = new ApplicationURI(uri); return appUriFromRoute.equals(appUriFromString); } private UriUtil(); static String stripScheme(String uri); static Clou... |
@Test void testRouteMatchesWithHostBasedUriWithoutPort() { boolean actualResult = UriUtil.routeMatchesUri(route, HOST_BASED_URI_WITHOUT_PORT); Assertions.assertTrue(actualResult); } | public static boolean routeMatchesUri(CloudRoute route, String uri) { ApplicationURI appUriFromRoute = new ApplicationURI(route); ApplicationURI appUriFromString = new ApplicationURI(uri); return appUriFromRoute.equals(appUriFromString); } | UriUtil { public static boolean routeMatchesUri(CloudRoute route, String uri) { ApplicationURI appUriFromRoute = new ApplicationURI(route); ApplicationURI appUriFromString = new ApplicationURI(uri); return appUriFromRoute.equals(appUriFromString); } } | UriUtil { public static boolean routeMatchesUri(CloudRoute route, String uri) { ApplicationURI appUriFromRoute = new ApplicationURI(route); ApplicationURI appUriFromString = new ApplicationURI(uri); return appUriFromRoute.equals(appUriFromString); } private UriUtil(); } | UriUtil { public static boolean routeMatchesUri(CloudRoute route, String uri) { ApplicationURI appUriFromRoute = new ApplicationURI(route); ApplicationURI appUriFromString = new ApplicationURI(uri); return appUriFromRoute.equals(appUriFromString); } private UriUtil(); static String stripScheme(String uri); static Clou... | UriUtil { public static boolean routeMatchesUri(CloudRoute route, String uri) { ApplicationURI appUriFromRoute = new ApplicationURI(route); ApplicationURI appUriFromString = new ApplicationURI(uri); return appUriFromRoute.equals(appUriFromString); } private UriUtil(); static String stripScheme(String uri); static Clou... |
@Test void testRouteMatchesWithPortBasedUri() { boolean actualResult = UriUtil.routeMatchesUri(route, PORT_BASED_URI); Assertions.assertFalse(actualResult); } | public static boolean routeMatchesUri(CloudRoute route, String uri) { ApplicationURI appUriFromRoute = new ApplicationURI(route); ApplicationURI appUriFromString = new ApplicationURI(uri); return appUriFromRoute.equals(appUriFromString); } | UriUtil { public static boolean routeMatchesUri(CloudRoute route, String uri) { ApplicationURI appUriFromRoute = new ApplicationURI(route); ApplicationURI appUriFromString = new ApplicationURI(uri); return appUriFromRoute.equals(appUriFromString); } } | UriUtil { public static boolean routeMatchesUri(CloudRoute route, String uri) { ApplicationURI appUriFromRoute = new ApplicationURI(route); ApplicationURI appUriFromString = new ApplicationURI(uri); return appUriFromRoute.equals(appUriFromString); } private UriUtil(); } | UriUtil { public static boolean routeMatchesUri(CloudRoute route, String uri) { ApplicationURI appUriFromRoute = new ApplicationURI(route); ApplicationURI appUriFromString = new ApplicationURI(uri); return appUriFromRoute.equals(appUriFromString); } private UriUtil(); static String stripScheme(String uri); static Clou... | UriUtil { public static boolean routeMatchesUri(CloudRoute route, String uri) { ApplicationURI appUriFromRoute = new ApplicationURI(route); ApplicationURI appUriFromString = new ApplicationURI(uri); return appUriFromRoute.equals(appUriFromString); } private UriUtil(); static String stripScheme(String uri); static Clou... |
@Test void testGetNullProcessLogger() { processLogger = processLoggerProvider.getLogger(execution); assertTrue(processLogger instanceof NullProcessLogger, MessageFormat.format("Expected NullProcessLogger but was {0}", processLogger.getClass() .getSimpleName())); } | public ProcessLogger getLogger(DelegateExecution execution) { return getLogger(execution, DEFAULT_LOG_NAME); } | ProcessLoggerProvider { public ProcessLogger getLogger(DelegateExecution execution) { return getLogger(execution, DEFAULT_LOG_NAME); } } | ProcessLoggerProvider { public ProcessLogger getLogger(DelegateExecution execution) { return getLogger(execution, DEFAULT_LOG_NAME); } } | ProcessLoggerProvider { public ProcessLogger getLogger(DelegateExecution execution) { return getLogger(execution, DEFAULT_LOG_NAME); } ProcessLogger getLogger(DelegateExecution execution); ProcessLogger getLogger(DelegateExecution execution, String logName); ProcessLogger getLogger(DelegateExecution execution, String ... | ProcessLoggerProvider { public ProcessLogger getLogger(DelegateExecution execution) { return getLogger(execution, DEFAULT_LOG_NAME); } ProcessLogger getLogger(DelegateExecution execution); ProcessLogger getLogger(DelegateExecution execution, String logName); ProcessLogger getLogger(DelegateExecution execution, String ... |
@Test void testStripSchemeWithScheme() { String actual = UriUtil.stripScheme(PORT_BASED_URI); Assertions.assertEquals(PORT_BASED_URI_WITHOUT_SCHEME, actual); } | public static String stripScheme(String uri) { int protocolIndex = uri.indexOf(DEFAULT_SCHEME_SEPARATOR); if (protocolIndex == -1) { return uri; } return uri.substring(protocolIndex + DEFAULT_SCHEME_SEPARATOR.length()); } | UriUtil { public static String stripScheme(String uri) { int protocolIndex = uri.indexOf(DEFAULT_SCHEME_SEPARATOR); if (protocolIndex == -1) { return uri; } return uri.substring(protocolIndex + DEFAULT_SCHEME_SEPARATOR.length()); } } | UriUtil { public static String stripScheme(String uri) { int protocolIndex = uri.indexOf(DEFAULT_SCHEME_SEPARATOR); if (protocolIndex == -1) { return uri; } return uri.substring(protocolIndex + DEFAULT_SCHEME_SEPARATOR.length()); } private UriUtil(); } | UriUtil { public static String stripScheme(String uri) { int protocolIndex = uri.indexOf(DEFAULT_SCHEME_SEPARATOR); if (protocolIndex == -1) { return uri; } return uri.substring(protocolIndex + DEFAULT_SCHEME_SEPARATOR.length()); } private UriUtil(); static String stripScheme(String uri); static CloudRoute findRoute(L... | UriUtil { public static String stripScheme(String uri) { int protocolIndex = uri.indexOf(DEFAULT_SCHEME_SEPARATOR); if (protocolIndex == -1) { return uri; } return uri.substring(protocolIndex + DEFAULT_SCHEME_SEPARATOR.length()); } private UriUtil(); static String stripScheme(String uri); static CloudRoute findRoute(L... |
@Test void testStripSchemeWithoutScheme() { String actual = UriUtil.stripScheme(PORT_BASED_URI_WITHOUT_SCHEME); Assertions.assertEquals(PORT_BASED_URI_WITHOUT_SCHEME, actual); } | public static String stripScheme(String uri) { int protocolIndex = uri.indexOf(DEFAULT_SCHEME_SEPARATOR); if (protocolIndex == -1) { return uri; } return uri.substring(protocolIndex + DEFAULT_SCHEME_SEPARATOR.length()); } | UriUtil { public static String stripScheme(String uri) { int protocolIndex = uri.indexOf(DEFAULT_SCHEME_SEPARATOR); if (protocolIndex == -1) { return uri; } return uri.substring(protocolIndex + DEFAULT_SCHEME_SEPARATOR.length()); } } | UriUtil { public static String stripScheme(String uri) { int protocolIndex = uri.indexOf(DEFAULT_SCHEME_SEPARATOR); if (protocolIndex == -1) { return uri; } return uri.substring(protocolIndex + DEFAULT_SCHEME_SEPARATOR.length()); } private UriUtil(); } | UriUtil { public static String stripScheme(String uri) { int protocolIndex = uri.indexOf(DEFAULT_SCHEME_SEPARATOR); if (protocolIndex == -1) { return uri; } return uri.substring(protocolIndex + DEFAULT_SCHEME_SEPARATOR.length()); } private UriUtil(); static String stripScheme(String uri); static CloudRoute findRoute(L... | UriUtil { public static String stripScheme(String uri) { int protocolIndex = uri.indexOf(DEFAULT_SCHEME_SEPARATOR); if (protocolIndex == -1) { return uri; } return uri.substring(protocolIndex + DEFAULT_SCHEME_SEPARATOR.length()); } private UriUtil(); static String stripScheme(String uri); static CloudRoute findRoute(L... |
@Test void testCreateValidContainerName() { String containerName = NameUtil.computeValidContainerName("initial", "initial", "com.sap.cloud.lm.sl.xs2.a.very.very.long.service.name.with.illegal.container.name.characters"); assertEquals("INITIAL_INITIAL_COM_SAP_CLOUD_LM_SL_XS2_A_VERY_VERY_LONG3AC0B612", containerName); as... | public static String computeValidContainerName(String organization, String space, String serviceName) { String properOrganization = organization.toUpperCase(Locale.US) .replaceAll(NameRequirements.CONTAINER_NAME_ILLEGAL_CHARACTERS, "_"); String properSpace = space.toUpperCase(Locale.US) .replaceAll(NameRequirements.CON... | NameUtil { public static String computeValidContainerName(String organization, String space, String serviceName) { String properOrganization = organization.toUpperCase(Locale.US) .replaceAll(NameRequirements.CONTAINER_NAME_ILLEGAL_CHARACTERS, "_"); String properSpace = space.toUpperCase(Locale.US) .replaceAll(NameRequi... | NameUtil { public static String computeValidContainerName(String organization, String space, String serviceName) { String properOrganization = organization.toUpperCase(Locale.US) .replaceAll(NameRequirements.CONTAINER_NAME_ILLEGAL_CHARACTERS, "_"); String properSpace = space.toUpperCase(Locale.US) .replaceAll(NameRequi... | NameUtil { public static String computeValidContainerName(String organization, String space, String serviceName) { String properOrganization = organization.toUpperCase(Locale.US) .replaceAll(NameRequirements.CONTAINER_NAME_ILLEGAL_CHARACTERS, "_"); String properSpace = space.toUpperCase(Locale.US) .replaceAll(NameRequi... | NameUtil { public static String computeValidContainerName(String organization, String space, String serviceName) { String properOrganization = organization.toUpperCase(Locale.US) .replaceAll(NameRequirements.CONTAINER_NAME_ILLEGAL_CHARACTERS, "_"); String properSpace = space.toUpperCase(Locale.US) .replaceAll(NameRequi... |
@Test void testGetTokenUserInfo() { DefaultOAuth2AccessToken token = new DefaultOAuth2AccessToken(TOKEN); Map<String, Object> additionalInformation = asMap(USER_ID, USER_NAME); token.setAdditionalInformation(additionalInformation); UserInfo userInfo = SecurityUtil.getTokenUserInfo(token); assertEquals(USER_ID, userInfo... | public static UserInfo getTokenUserInfo(OAuth2AccessToken token) { TokenProperties tokenProperties = TokenProperties.fromToken(token); return new UserInfo(tokenProperties.getUserId(), tokenProperties.getUserName(), token); } | SecurityUtil { public static UserInfo getTokenUserInfo(OAuth2AccessToken token) { TokenProperties tokenProperties = TokenProperties.fromToken(token); return new UserInfo(tokenProperties.getUserId(), tokenProperties.getUserName(), token); } } | SecurityUtil { public static UserInfo getTokenUserInfo(OAuth2AccessToken token) { TokenProperties tokenProperties = TokenProperties.fromToken(token); return new UserInfo(tokenProperties.getUserId(), tokenProperties.getUserName(), token); } private SecurityUtil(); } | SecurityUtil { public static UserInfo getTokenUserInfo(OAuth2AccessToken token) { TokenProperties tokenProperties = TokenProperties.fromToken(token); return new UserInfo(tokenProperties.getUserId(), tokenProperties.getUserName(), token); } private SecurityUtil(); static OAuth2Authentication createAuthentication(String... | SecurityUtil { public static UserInfo getTokenUserInfo(OAuth2AccessToken token) { TokenProperties tokenProperties = TokenProperties.fromToken(token); return new UserInfo(tokenProperties.getUserId(), tokenProperties.getUserName(), token); } private SecurityUtil(); static OAuth2Authentication createAuthentication(String... |
@Test void testGetURIParts() { ApplicationURI applicationURI = new ApplicationURI(createCloudRoute(CUSTOM + "host", createCloudDomain(CUSTOM + "domain"), null)); Map<String, Object> expectedParts = new HashMap<>(); expectedParts.put(SupportedParameters.HOST, CUSTOM + "host"); expectedParts.put(SupportedParameters.DOMAI... | public Map<String, Object> getURIParts() { Map<String, Object> uriParts = new HashMap<>(); uriParts.put(SupportedParameters.HOST, getHost()); uriParts.put(SupportedParameters.DOMAIN, getDomain()); uriParts.put(SupportedParameters.ROUTE_PATH, getPath()); return Collections.unmodifiableMap(uriParts); } | ApplicationURI { public Map<String, Object> getURIParts() { Map<String, Object> uriParts = new HashMap<>(); uriParts.put(SupportedParameters.HOST, getHost()); uriParts.put(SupportedParameters.DOMAIN, getDomain()); uriParts.put(SupportedParameters.ROUTE_PATH, getPath()); return Collections.unmodifiableMap(uriParts); } } | ApplicationURI { public Map<String, Object> getURIParts() { Map<String, Object> uriParts = new HashMap<>(); uriParts.put(SupportedParameters.HOST, getHost()); uriParts.put(SupportedParameters.DOMAIN, getDomain()); uriParts.put(SupportedParameters.ROUTE_PATH, getPath()); return Collections.unmodifiableMap(uriParts); } A... | ApplicationURI { public Map<String, Object> getURIParts() { Map<String, Object> uriParts = new HashMap<>(); uriParts.put(SupportedParameters.HOST, getHost()); uriParts.put(SupportedParameters.DOMAIN, getDomain()); uriParts.put(SupportedParameters.ROUTE_PATH, getPath()); return Collections.unmodifiableMap(uriParts); } A... | ApplicationURI { public Map<String, Object> getURIParts() { Map<String, Object> uriParts = new HashMap<>(); uriParts.put(SupportedParameters.HOST, getHost()); uriParts.put(SupportedParameters.DOMAIN, getDomain()); uriParts.put(SupportedParameters.ROUTE_PATH, getPath()); return Collections.unmodifiableMap(uriParts); } A... |
@Test void testGetURIPart() { ApplicationURI applicationURI = new ApplicationURI(createCloudRoute(CUSTOM + "host", createCloudDomain(CUSTOM + "domain"), "/" + CUSTOM + "path")); Assertions.assertEquals(CUSTOM + "host", applicationURI.getURIPart(SupportedParameters.HOST)); Assertions.assertEquals(CUSTOM + "domain", appl... | public Object getURIPart(String partName) { switch (partName) { case SupportedParameters.HOST: return getHost(); case SupportedParameters.DOMAIN: return getDomain(); case SupportedParameters.ROUTE_PATH: return getPath(); default: return null; } } | ApplicationURI { public Object getURIPart(String partName) { switch (partName) { case SupportedParameters.HOST: return getHost(); case SupportedParameters.DOMAIN: return getDomain(); case SupportedParameters.ROUTE_PATH: return getPath(); default: return null; } } } | ApplicationURI { public Object getURIPart(String partName) { switch (partName) { case SupportedParameters.HOST: return getHost(); case SupportedParameters.DOMAIN: return getDomain(); case SupportedParameters.ROUTE_PATH: return getPath(); default: return null; } } ApplicationURI(String initial); ApplicationURI(CloudRou... | ApplicationURI { public Object getURIPart(String partName) { switch (partName) { case SupportedParameters.HOST: return getHost(); case SupportedParameters.DOMAIN: return getDomain(); case SupportedParameters.ROUTE_PATH: return getPath(); default: return null; } } ApplicationURI(String initial); ApplicationURI(CloudRou... | ApplicationURI { public Object getURIPart(String partName) { switch (partName) { case SupportedParameters.HOST: return getHost(); case SupportedParameters.DOMAIN: return getDomain(); case SupportedParameters.ROUTE_PATH: return getPath(); default: return null; } } ApplicationURI(String initial); ApplicationURI(CloudRou... |
@Test void testToStringWithValidHostAndPath() { ApplicationURI applicationURI = new ApplicationURI(createCloudRoute(CUSTOM + "host", createCloudDomain(CUSTOM + "domain"), "/" + CUSTOM + "path")); String expectedApplicationURI = CUSTOM + "host." + CUSTOM + "domain/" + CUSTOM + "path"; Assertions.assertEquals(expectedApp... | @Override public String toString() { StringBuilder url = new StringBuilder(); if (StringUtils.isNotEmpty(getHost())) { url.append(getHost()) .append(UriUtil.DEFAULT_HOST_DOMAIN_SEPARATOR); } url.append(getDomain()); if (StringUtils.isNotEmpty(getPath())) { url.append(getPath()); } return url.toString(); } | ApplicationURI { @Override public String toString() { StringBuilder url = new StringBuilder(); if (StringUtils.isNotEmpty(getHost())) { url.append(getHost()) .append(UriUtil.DEFAULT_HOST_DOMAIN_SEPARATOR); } url.append(getDomain()); if (StringUtils.isNotEmpty(getPath())) { url.append(getPath()); } return url.toString()... | ApplicationURI { @Override public String toString() { StringBuilder url = new StringBuilder(); if (StringUtils.isNotEmpty(getHost())) { url.append(getHost()) .append(UriUtil.DEFAULT_HOST_DOMAIN_SEPARATOR); } url.append(getDomain()); if (StringUtils.isNotEmpty(getPath())) { url.append(getPath()); } return url.toString()... | ApplicationURI { @Override public String toString() { StringBuilder url = new StringBuilder(); if (StringUtils.isNotEmpty(getHost())) { url.append(getHost()) .append(UriUtil.DEFAULT_HOST_DOMAIN_SEPARATOR); } url.append(getDomain()); if (StringUtils.isNotEmpty(getPath())) { url.append(getPath()); } return url.toString()... | ApplicationURI { @Override public String toString() { StringBuilder url = new StringBuilder(); if (StringUtils.isNotEmpty(getHost())) { url.append(getHost()) .append(UriUtil.DEFAULT_HOST_DOMAIN_SEPARATOR); } url.append(getDomain()); if (StringUtils.isNotEmpty(getPath())) { url.append(getPath()); } return url.toString()... |
@Test void testToStringWithValidHostAndWithoutPath() { ApplicationURI applicationURI = new ApplicationURI(createCloudRoute(CUSTOM + "host", createCloudDomain(CUSTOM + "domain"), null)); Assertions.assertEquals(CUSTOM + "host." + CUSTOM + "domain", applicationURI.toString()); } | @Override public String toString() { StringBuilder url = new StringBuilder(); if (StringUtils.isNotEmpty(getHost())) { url.append(getHost()) .append(UriUtil.DEFAULT_HOST_DOMAIN_SEPARATOR); } url.append(getDomain()); if (StringUtils.isNotEmpty(getPath())) { url.append(getPath()); } return url.toString(); } | ApplicationURI { @Override public String toString() { StringBuilder url = new StringBuilder(); if (StringUtils.isNotEmpty(getHost())) { url.append(getHost()) .append(UriUtil.DEFAULT_HOST_DOMAIN_SEPARATOR); } url.append(getDomain()); if (StringUtils.isNotEmpty(getPath())) { url.append(getPath()); } return url.toString()... | ApplicationURI { @Override public String toString() { StringBuilder url = new StringBuilder(); if (StringUtils.isNotEmpty(getHost())) { url.append(getHost()) .append(UriUtil.DEFAULT_HOST_DOMAIN_SEPARATOR); } url.append(getDomain()); if (StringUtils.isNotEmpty(getPath())) { url.append(getPath()); } return url.toString()... | ApplicationURI { @Override public String toString() { StringBuilder url = new StringBuilder(); if (StringUtils.isNotEmpty(getHost())) { url.append(getHost()) .append(UriUtil.DEFAULT_HOST_DOMAIN_SEPARATOR); } url.append(getDomain()); if (StringUtils.isNotEmpty(getPath())) { url.append(getPath()); } return url.toString()... | ApplicationURI { @Override public String toString() { StringBuilder url = new StringBuilder(); if (StringUtils.isNotEmpty(getHost())) { url.append(getHost()) .append(UriUtil.DEFAULT_HOST_DOMAIN_SEPARATOR); } url.append(getDomain()); if (StringUtils.isNotEmpty(getPath())) { url.append(getPath()); } return url.toString()... |
@Test void testToStringWithoutHostAndWithoutPath() { ApplicationURI applicationURI = new ApplicationURI(createCloudRoute("", createCloudDomain(CUSTOM + "domain"), null)); Assertions.assertEquals(CUSTOM + "domain", applicationURI.toString()); } | @Override public String toString() { StringBuilder url = new StringBuilder(); if (StringUtils.isNotEmpty(getHost())) { url.append(getHost()) .append(UriUtil.DEFAULT_HOST_DOMAIN_SEPARATOR); } url.append(getDomain()); if (StringUtils.isNotEmpty(getPath())) { url.append(getPath()); } return url.toString(); } | ApplicationURI { @Override public String toString() { StringBuilder url = new StringBuilder(); if (StringUtils.isNotEmpty(getHost())) { url.append(getHost()) .append(UriUtil.DEFAULT_HOST_DOMAIN_SEPARATOR); } url.append(getDomain()); if (StringUtils.isNotEmpty(getPath())) { url.append(getPath()); } return url.toString()... | ApplicationURI { @Override public String toString() { StringBuilder url = new StringBuilder(); if (StringUtils.isNotEmpty(getHost())) { url.append(getHost()) .append(UriUtil.DEFAULT_HOST_DOMAIN_SEPARATOR); } url.append(getDomain()); if (StringUtils.isNotEmpty(getPath())) { url.append(getPath()); } return url.toString()... | ApplicationURI { @Override public String toString() { StringBuilder url = new StringBuilder(); if (StringUtils.isNotEmpty(getHost())) { url.append(getHost()) .append(UriUtil.DEFAULT_HOST_DOMAIN_SEPARATOR); } url.append(getDomain()); if (StringUtils.isNotEmpty(getPath())) { url.append(getPath()); } return url.toString()... | ApplicationURI { @Override public String toString() { StringBuilder url = new StringBuilder(); if (StringUtils.isNotEmpty(getHost())) { url.append(getHost()) .append(UriUtil.DEFAULT_HOST_DOMAIN_SEPARATOR); } url.append(getDomain()); if (StringUtils.isNotEmpty(getPath())) { url.append(getPath()); } return url.toString()... |
@Test void testGetDomainFromURI() { Assertions.assertEquals(CUSTOM + "domain", ApplicationURI.getDomainFromURI("https: } | public static String getDomainFromURI(String uri) { ApplicationURI parsedURI = new ApplicationURI(uri); return parsedURI.getDomain(); } | ApplicationURI { public static String getDomainFromURI(String uri) { ApplicationURI parsedURI = new ApplicationURI(uri); return parsedURI.getDomain(); } } | ApplicationURI { public static String getDomainFromURI(String uri) { ApplicationURI parsedURI = new ApplicationURI(uri); return parsedURI.getDomain(); } ApplicationURI(String initial); ApplicationURI(CloudRoute route); } | ApplicationURI { public static String getDomainFromURI(String uri) { ApplicationURI parsedURI = new ApplicationURI(uri); return parsedURI.getDomain(); } ApplicationURI(String initial); ApplicationURI(CloudRoute route); static String getDomainFromURI(String uri); Map<String, Object> getURIParts(); Object getURIPart(Str... | ApplicationURI { public static String getDomainFromURI(String uri) { ApplicationURI parsedURI = new ApplicationURI(uri); return parsedURI.getDomain(); } ApplicationURI(String initial); ApplicationURI(CloudRoute route); static String getDomainFromURI(String uri); Map<String, Object> getURIParts(); Object getURIPart(Str... |
@Test void testAdd() { configurationEntryService.add(CONFIGURATION_ENTRY_1); assertEquals(1, configurationEntryService.createQuery() .list() .size()); assertEquals(CONFIGURATION_ENTRY_1.getId(), configurationEntryService.createQuery() .id(CONFIGURATION_ENTRY_1.getId()) .singleResult() .getId()); } | public ConfigurationEntryQuery createQuery() { return new ConfigurationEntryQueryImpl(createEntityManager(), entryMapper); } | ConfigurationEntryService extends PersistenceService<ConfigurationEntry, ConfigurationEntryDto, Long> { public ConfigurationEntryQuery createQuery() { return new ConfigurationEntryQueryImpl(createEntityManager(), entryMapper); } } | ConfigurationEntryService extends PersistenceService<ConfigurationEntry, ConfigurationEntryDto, Long> { public ConfigurationEntryQuery createQuery() { return new ConfigurationEntryQueryImpl(createEntityManager(), entryMapper); } ConfigurationEntryService(EntityManagerFactory entityManagerFactory, ConfigurationEntryMapp... | ConfigurationEntryService extends PersistenceService<ConfigurationEntry, ConfigurationEntryDto, Long> { public ConfigurationEntryQuery createQuery() { return new ConfigurationEntryQueryImpl(createEntityManager(), entryMapper); } ConfigurationEntryService(EntityManagerFactory entityManagerFactory, ConfigurationEntryMapp... | ConfigurationEntryService extends PersistenceService<ConfigurationEntry, ConfigurationEntryDto, Long> { public ConfigurationEntryQuery createQuery() { return new ConfigurationEntryQueryImpl(createEntityManager(), entryMapper); } ConfigurationEntryService(EntityManagerFactory entityManagerFactory, ConfigurationEntryMapp... |
@Test void checkRequiredParametersForManagedServiceWithNoParameters() { Map<String, Object> dummyParameters = new HashMap<>(); ResourceType resourceType = ResourceType.MANAGED_SERVICE; Assertions.assertThrows(ContentException.class, () -> SpecialResourceTypesRequiredParametersUtil.checkRequiredParameters(testServiceNam... | public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parameter)) { throw new ContentException(Messages.S... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... |
@Test void checkRequiredParametersForManagedServiceWithMissingParameter() { Map<String, Object> dummyParameters = new HashMap<>(); dummyParameters.put("service", new Object()); ResourceType resourceType = ResourceType.MANAGED_SERVICE; Assertions.assertThrows(ContentException.class, () -> SpecialResourceTypesRequiredPar... | public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parameter)) { throw new ContentException(Messages.S... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... |
@Test void checkRequiredParametersForManagedServiceWithRequiredParameter() { Map<String, Object> dummyParameters = new HashMap<>(); dummyParameters.put("service", new Object()); dummyParameters.put("service-plan", new Object()); ResourceType resourceType = ResourceType.MANAGED_SERVICE; Assertions.assertDoesNotThrow(() ... | public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parameter)) { throw new ContentException(Messages.S... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... |
@Test void checkRequiredParametersForUserProvidedServiceWithNoParameters() { Map<String, Object> dummyParameters = new HashMap<>(); ResourceType resourceType = ResourceType.USER_PROVIDED_SERVICE; Assertions.assertDoesNotThrow(() -> SpecialResourceTypesRequiredParametersUtil.checkRequiredParameters(testServiceName, reso... | public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parameter)) { throw new ContentException(Messages.S... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... |
@Test void checkRequiredParametersForUserProvidedServiceWithRequiredParameter() { Map<String, Object> dummyParameters = new HashMap<>(); dummyParameters.put("config", new Object()); ResourceType resourceType = ResourceType.USER_PROVIDED_SERVICE; Assertions.assertDoesNotThrow(() -> SpecialResourceTypesRequiredParameters... | public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parameter)) { throw new ContentException(Messages.S... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... |
@Test void checkRequiredParametersForExistingServiceWithNoParameters() { Map<String, Object> dummyParameters = new HashMap<>(); ResourceType resourceType = ResourceType.EXISTING_SERVICE; Assertions.assertDoesNotThrow(() -> SpecialResourceTypesRequiredParametersUtil.checkRequiredParameters(testServiceName, resourceType,... | public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parameter)) { throw new ContentException(Messages.S... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... | SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parame... |
@Test void testLoadDefaultsWithAnEmptyEnvironment() { Exception e = assertThrows(IllegalArgumentException.class, () -> configuration.load()); assertEquals(Messages.CONTROLLER_URL_NOT_SPECIFIED, e.getMessage()); } | public void load() { getControllerUrl(); getMaxUploadSize(); getMaxMtaDescriptorSize(); getMaxManifestSize(); getMaxResourceFileSize(); shouldUseXSAuditLogging(); getSpaceGuid(); getOrgName(); getDeployServiceUrl(); isBasicAuthEnabled(); getGlobalAuditorUser(); getGlobalAuditorPassword(); getDbConnectionThreads(); getS... | ApplicationConfiguration { public void load() { getControllerUrl(); getMaxUploadSize(); getMaxMtaDescriptorSize(); getMaxManifestSize(); getMaxResourceFileSize(); shouldUseXSAuditLogging(); getSpaceGuid(); getOrgName(); getDeployServiceUrl(); isBasicAuthEnabled(); getGlobalAuditorUser(); getGlobalAuditorPassword(); get... | ApplicationConfiguration { public void load() { getControllerUrl(); getMaxUploadSize(); getMaxMtaDescriptorSize(); getMaxManifestSize(); getMaxResourceFileSize(); shouldUseXSAuditLogging(); getSpaceGuid(); getOrgName(); getDeployServiceUrl(); isBasicAuthEnabled(); getGlobalAuditorUser(); getGlobalAuditorPassword(); get... | ApplicationConfiguration { public void load() { getControllerUrl(); getMaxUploadSize(); getMaxMtaDescriptorSize(); getMaxManifestSize(); getMaxResourceFileSize(); shouldUseXSAuditLogging(); getSpaceGuid(); getOrgName(); getDeployServiceUrl(); isBasicAuthEnabled(); getGlobalAuditorUser(); getGlobalAuditorPassword(); get... | ApplicationConfiguration { public void load() { getControllerUrl(); getMaxUploadSize(); getMaxMtaDescriptorSize(); getMaxManifestSize(); getMaxResourceFileSize(); shouldUseXSAuditLogging(); getSpaceGuid(); getOrgName(); getDeployServiceUrl(); isBasicAuthEnabled(); getGlobalAuditorUser(); getGlobalAuditorPassword(); get... |
@Test void testGetControllerUrl() throws Exception { URL expectedControllerUrl = new URL("https: Map<String, String> vcapApplication = Map.of("cf_api", expectedControllerUrl.toString()); assertEquals(expectedControllerUrl, getControllerUrlWithVcapApplication(vcapApplication)); } | public URL getControllerUrl() { if (controllerUrl == null) { controllerUrl = getControllerUrlFromEnvironment(); } return controllerUrl; } | ApplicationConfiguration { public URL getControllerUrl() { if (controllerUrl == null) { controllerUrl = getControllerUrlFromEnvironment(); } return controllerUrl; } } | ApplicationConfiguration { public URL getControllerUrl() { if (controllerUrl == null) { controllerUrl = getControllerUrlFromEnvironment(); } return controllerUrl; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); } | ApplicationConfiguration { public URL getControllerUrl() { if (controllerUrl == null) { controllerUrl = getControllerUrlFromEnvironment(); } return controllerUrl; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Config... | ApplicationConfiguration { public URL getControllerUrl() { if (controllerUrl == null) { controllerUrl = getControllerUrlFromEnvironment(); } return controllerUrl; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Config... |
@Test void testGetSpaceGuidWithNull() { assertEquals(ApplicationConfiguration.DEFAULT_SPACE_GUID, configuration.getSpaceGuid()); } | public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Configuration getFileCo... | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Configuration getFileCo... |
@Test void testGetSpaceGuidWithEmptyString() { Mockito.when(environment.getString(ApplicationConfiguration.CFG_VCAP_APPLICATION)) .thenReturn(""); assertEquals(ApplicationConfiguration.DEFAULT_SPACE_GUID, configuration.getSpaceGuid()); } | public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Configuration getFileCo... | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Configuration getFileCo... |
@Test void testAddWithNonEmptyDatabase() { addConfigurationEntries(List.of(CONFIGURATION_ENTRY_1, CONFIGURATION_ENTRY_2)); assertConfigurationEntryExists(CONFIGURATION_ENTRY_1.getId()); assertConfigurationEntryExists(CONFIGURATION_ENTRY_2.getId()); assertEquals(2, configurationEntryService.createQuery() .list() .size()... | public ConfigurationEntryQuery createQuery() { return new ConfigurationEntryQueryImpl(createEntityManager(), entryMapper); } | ConfigurationEntryService extends PersistenceService<ConfigurationEntry, ConfigurationEntryDto, Long> { public ConfigurationEntryQuery createQuery() { return new ConfigurationEntryQueryImpl(createEntityManager(), entryMapper); } } | ConfigurationEntryService extends PersistenceService<ConfigurationEntry, ConfigurationEntryDto, Long> { public ConfigurationEntryQuery createQuery() { return new ConfigurationEntryQueryImpl(createEntityManager(), entryMapper); } ConfigurationEntryService(EntityManagerFactory entityManagerFactory, ConfigurationEntryMapp... | ConfigurationEntryService extends PersistenceService<ConfigurationEntry, ConfigurationEntryDto, Long> { public ConfigurationEntryQuery createQuery() { return new ConfigurationEntryQueryImpl(createEntityManager(), entryMapper); } ConfigurationEntryService(EntityManagerFactory entityManagerFactory, ConfigurationEntryMapp... | ConfigurationEntryService extends PersistenceService<ConfigurationEntry, ConfigurationEntryDto, Long> { public ConfigurationEntryQuery createQuery() { return new ConfigurationEntryQueryImpl(createEntityManager(), entryMapper); } ConfigurationEntryService(EntityManagerFactory entityManagerFactory, ConfigurationEntryMapp... |
@Test void testGetSpaceGuidWithInvalidJson() { Mockito.when(environment.getString(ApplicationConfiguration.CFG_VCAP_APPLICATION)) .thenReturn("invalid"); assertEquals(ApplicationConfiguration.DEFAULT_SPACE_GUID, configuration.getSpaceGuid()); } | public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Configuration getFileCo... | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Configuration getFileCo... |
@Test void testGetSpaceGuidWithEmptyMap() { Mockito.when(environment.getString(ApplicationConfiguration.CFG_VCAP_APPLICATION)) .thenReturn("{}"); assertEquals(ApplicationConfiguration.DEFAULT_SPACE_GUID, configuration.getSpaceGuid()); } | public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Configuration getFileCo... | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Configuration getFileCo... |
@Test void testGetSpaceGuidWithMissingSpaceGuid() { injectFileInEnvironment(VCAP_APPLICATION_WITHOUT_SPACE, ApplicationConfiguration.CFG_VCAP_APPLICATION); assertEquals(ApplicationConfiguration.DEFAULT_SPACE_GUID, configuration.getSpaceGuid()); } | public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Configuration getFileCo... | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Configuration getFileCo... |
@Test void testGetSpaceGuid() { Map<String, Object> vcapApplication = injectFileInEnvironment(VCAP_APPLICATION, ApplicationConfiguration.CFG_VCAP_APPLICATION); String spaceId = configuration.getSpaceGuid(); assertEquals(vcapApplication.get("space_id"), spaceId); } | public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); } | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Configuration getFileCo... | ApplicationConfiguration { public String getSpaceGuid() { if (spaceGuid == null) { spaceGuid = getSpaceGuidFromEnvironment(); } return spaceGuid; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Configuration getFileCo... |
@Test void testGetPlatformValidPlatform() { Map<String, Object> platformMap = injectFileInEnvironment(PLATFORM, ApplicationConfiguration.CFG_PLATFORM); Platform platform = configuration.getPlatform(); Assertions.assertEquals(platformMap.get("name"), platform.getName()); Assertions.assertFalse(platform.getResourceTypes(... | public Platform getPlatform() { if (platform == null) { platform = getPlatformFromEnvironment(); } return platform; } | ApplicationConfiguration { public Platform getPlatform() { if (platform == null) { platform = getPlatformFromEnvironment(); } return platform; } } | ApplicationConfiguration { public Platform getPlatform() { if (platform == null) { platform = getPlatformFromEnvironment(); } return platform; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); } | ApplicationConfiguration { public Platform getPlatform() { if (platform == null) { platform = getPlatformFromEnvironment(); } return platform; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Configuration getFileConfi... | ApplicationConfiguration { public Platform getPlatform() { if (platform == null) { platform = getPlatformFromEnvironment(); } return platform; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Configuration getFileConfi... |
@Test void testGetPlatformNoPlatformInEnvironment() { Exception exception = assertThrows(IllegalStateException.class, () -> configuration.getPlatform()); Assertions.assertEquals(Messages.PLATFORMS_NOT_SPECIFIED, exception.getMessage()); } | public Platform getPlatform() { if (platform == null) { platform = getPlatformFromEnvironment(); } return platform; } | ApplicationConfiguration { public Platform getPlatform() { if (platform == null) { platform = getPlatformFromEnvironment(); } return platform; } } | ApplicationConfiguration { public Platform getPlatform() { if (platform == null) { platform = getPlatformFromEnvironment(); } return platform; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); } | ApplicationConfiguration { public Platform getPlatform() { if (platform == null) { platform = getPlatformFromEnvironment(); } return platform; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Configuration getFileConfi... | ApplicationConfiguration { public Platform getPlatform() { if (platform == null) { platform = getPlatformFromEnvironment(); } return platform; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Configuration getFileConfi... |
@Test void testGetMaxUploadSize() { Mockito.when(environment.getLong(ApplicationConfiguration.CFG_MAX_UPLOAD_SIZE, ApplicationConfiguration.DEFAULT_MAX_UPLOAD_SIZE)) .thenReturn(ApplicationConfiguration.DEFAULT_MAX_UPLOAD_SIZE); Assertions.assertEquals(ApplicationConfiguration.DEFAULT_MAX_UPLOAD_SIZE, configuration.get... | public Long getMaxUploadSize() { if (maxUploadSize == null) { maxUploadSize = getMaxUploadSizeFromEnvironment(); } return maxUploadSize; } | ApplicationConfiguration { public Long getMaxUploadSize() { if (maxUploadSize == null) { maxUploadSize = getMaxUploadSizeFromEnvironment(); } return maxUploadSize; } } | ApplicationConfiguration { public Long getMaxUploadSize() { if (maxUploadSize == null) { maxUploadSize = getMaxUploadSizeFromEnvironment(); } return maxUploadSize; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); } | ApplicationConfiguration { public Long getMaxUploadSize() { if (maxUploadSize == null) { maxUploadSize = getMaxUploadSizeFromEnvironment(); } return maxUploadSize; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Confi... | ApplicationConfiguration { public Long getMaxUploadSize() { if (maxUploadSize == null) { maxUploadSize = getMaxUploadSizeFromEnvironment(); } return maxUploadSize; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String> getNotSensitiveVariables(); Confi... |
@Test void testGetMaxMtaDescriptorSize() { Mockito.when(environment.getLong(ApplicationConfiguration.CFG_MAX_MTA_DESCRIPTOR_SIZE, ApplicationConfiguration.DEFAULT_MAX_MTA_DESCRIPTOR_SIZE)) .thenReturn(ApplicationConfiguration.DEFAULT_MAX_MTA_DESCRIPTOR_SIZE); Assertions.assertEquals(ApplicationConfiguration.DEFAULT_MAX... | public Long getMaxMtaDescriptorSize() { if (maxMtaDescriptorSize == null) { maxMtaDescriptorSize = getMaxMtaDescriptorSizeFromEnvironment(); } return maxMtaDescriptorSize; } | ApplicationConfiguration { public Long getMaxMtaDescriptorSize() { if (maxMtaDescriptorSize == null) { maxMtaDescriptorSize = getMaxMtaDescriptorSizeFromEnvironment(); } return maxMtaDescriptorSize; } } | ApplicationConfiguration { public Long getMaxMtaDescriptorSize() { if (maxMtaDescriptorSize == null) { maxMtaDescriptorSize = getMaxMtaDescriptorSizeFromEnvironment(); } return maxMtaDescriptorSize; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); } | ApplicationConfiguration { public Long getMaxMtaDescriptorSize() { if (maxMtaDescriptorSize == null) { maxMtaDescriptorSize = getMaxMtaDescriptorSizeFromEnvironment(); } return maxMtaDescriptorSize; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String... | ApplicationConfiguration { public Long getMaxMtaDescriptorSize() { if (maxMtaDescriptorSize == null) { maxMtaDescriptorSize = getMaxMtaDescriptorSizeFromEnvironment(); } return maxMtaDescriptorSize; } ApplicationConfiguration(); @Inject ApplicationConfiguration(Environment environment); void load(); Map<String, String... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.