@Test public void retrieveAgentName() { when(cachedDataService.getPlatformIdentForId(1L)).thenReturn(platformIdent); when(invocationSequenceData.getPlatformIdent()).thenReturn(1L); when(platformIdent.getAgentName()).thenReturn("agentName"); String[] values = valueSource.getStringValues(invocationSequenceData, cachedDataService); assertThat(values, is(arrayContaining("agentName"))); }
return new HttpUriValueSource(); case AGENT: return new AgentNameValueSource(); default: throw new RuntimeException("Unsupported value source type!");
break; case AGENT: expression.setStringValueSource(new AgentNameValueSource()); break; default:
@Test public void platformIdentIsNull() { when(cachedDataService.getPlatformIdentForId(1L)).thenReturn(null); when(invocationSequenceData.getPlatformIdent()).thenReturn(1L); String[] values = valueSource.getStringValues(invocationSequenceData, cachedDataService); assertThat(values, is(emptyArray())); } }