SCT-8: Added NoOpTaskExplorer

Set the Junit to test scope.
This commit is contained in:
Michael Minella
2015-11-25 11:55:22 -06:00
committed by Glenn Renfro
parent bd5dab7bc9
commit 93e4698175
5 changed files with 121 additions and 2 deletions

View File

@@ -0,0 +1,59 @@
/*
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.task.repository.support;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import org.junit.Before;
import org.junit.Test;
import org.springframework.cloud.task.repository.TaskExplorer;
public class NoOpTaskExplorerTest {
private TaskExplorer taskExplorer;
@Before
public void setUp() throws Exception {
taskExplorer = new NoOpTaskExplorer();
}
@Test
public void testGetTaskExecution() throws Exception {
assertNull(taskExplorer.getTaskExecution(3l));
}
@Test
public void testFindRunningTaskExecutions() throws Exception {
assertEquals(taskExplorer.findRunningTaskExecutions("foo").size(), 0);
}
@Test
public void testGetTaskNames() throws Exception {
assertEquals(taskExplorer.getTaskNames().size(), 0);
}
@Test
public void testGetTaskExecutionCount() throws Exception {
assertEquals(taskExplorer.getTaskExecutionCount("foo"), 0);
}
@Test
public void testGetTaskExecutionsByName() throws Exception {
assertEquals(taskExplorer.getTaskExecutionsByName("foo", 0, 100).size(), 0);
}
}