use of com.mercedesbenz.sechub.commons.model.SecHubTimeUnit in project sechub by mercedes-benz.
the class NetsparkerLoginScriptGenerator method getWaitTimeInMilliseconds.
private Long getWaitTimeInMilliseconds(LoginScriptAction step) {
Long wait = null;
if (step.isWait()) {
long waitValue = Long.valueOf(step.getValue());
SecHubTimeUnit unit = step.getUnit();
wait = waitValue * unit.getMultiplicatorMilliseconds();
}
return wait;
}
use of com.mercedesbenz.sechub.commons.model.SecHubTimeUnit in project sechub by mercedes-benz.
the class SecHubTimeUnitTest method from_json_minute.
@ParameterizedTest
@ValueSource(strings = { "\"MINUTE\"", "\"minute\"", "\"minutes\"", "\"MINUTES\"" })
public void from_json_minute(String json) throws JsonMappingException, JsonProcessingException {
/* prepare */
ObjectMapper objectMapper = new ObjectMapper();
/* execute */
SecHubTimeUnit unit = objectMapper.readValue(json, SecHubTimeUnit.class);
/* test */
assertEquals(SecHubTimeUnit.MINUTE, unit);
}
use of com.mercedesbenz.sechub.commons.model.SecHubTimeUnit in project sechub by mercedes-benz.
the class SecHubTimeUnitTest method from_json_hours.
@ParameterizedTest
@ValueSource(strings = { "\"HOUR\"", "\"hour\"", "\"hours\"", "\"HOURS\"" })
public void from_json_hours(String json) throws JsonMappingException, JsonProcessingException {
/* prepare */
ObjectMapper objectMapper = new ObjectMapper();
/* execute */
SecHubTimeUnit unit = objectMapper.readValue(json, SecHubTimeUnit.class);
/* test */
assertEquals(SecHubTimeUnit.HOUR, unit);
}
use of com.mercedesbenz.sechub.commons.model.SecHubTimeUnit in project sechub by mercedes-benz.
the class SecHubTimeUnitTest method from_json_millisecond.
@ParameterizedTest
@ValueSource(strings = { "\"MILLISECOND\"", "\"millisecond\"", "\"milliseconds\"", "\"MILLISECONDS\"" })
public void from_json_millisecond(String json) throws JsonMappingException, JsonProcessingException {
/* prepare */
ObjectMapper objectMapper = new ObjectMapper();
/* execute */
SecHubTimeUnit unit = objectMapper.readValue(json, SecHubTimeUnit.class);
/* test */
assertEquals(SecHubTimeUnit.MILLISECOND, unit);
}
use of com.mercedesbenz.sechub.commons.model.SecHubTimeUnit in project sechub by mercedes-benz.
the class SecHubTimeUnitTest method from_json_days.
@ParameterizedTest
@ValueSource(strings = { "\"DAY\"", "\"day\"", "\"days\"", "\"DAYS\"" })
public void from_json_days(String json) throws JsonMappingException, JsonProcessingException {
/* prepare */
ObjectMapper objectMapper = new ObjectMapper();
/* execute */
SecHubTimeUnit unit = objectMapper.readValue(json, SecHubTimeUnit.class);
/* test */
assertEquals(SecHubTimeUnit.DAY, unit);
}
Aggregations