-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1664 from igarash1/master
- Loading branch information
Showing
4 changed files
with
329 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* | ||
* Copyright 2012-2018 CodeLibs Project and the Others. | ||
* | ||
* 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.codelibs.fess.it.admin; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.codelibs.fess.it.CrudTestBase; | ||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import io.restassured.path.json.JsonPath; | ||
|
||
@Tag("it") | ||
public class BackupTests extends CrudTestBase { | ||
|
||
private static final String NAME_PREFIX = "backupTest_"; | ||
private static final String API_PATH = "/api/admin/backup"; | ||
private static final String LIST_ENDPOINT_SUFFIX = "files"; | ||
private static final String ITEM_ENDPOINT_SUFFIX = "file"; | ||
|
||
private static final String KEY_PROPERTY = ""; | ||
|
||
@Override | ||
protected String getNamePrefix() { | ||
return NAME_PREFIX; | ||
} | ||
|
||
@Override | ||
protected String getApiPath() { | ||
return API_PATH; | ||
} | ||
|
||
@Override | ||
protected String getKeyProperty() { | ||
return KEY_PROPERTY; | ||
} | ||
|
||
@Override | ||
protected String getListEndpointSuffix() { | ||
return LIST_ENDPOINT_SUFFIX; | ||
} | ||
|
||
@Override | ||
protected String getItemEndpointSuffix() { | ||
return ITEM_ENDPOINT_SUFFIX; | ||
} | ||
|
||
@Override | ||
protected Map<String, Object> createTestParam(int id) { | ||
assertTrue(false); // Unreachable | ||
return null; | ||
} | ||
|
||
@Override | ||
protected Map<String, Object> getUpdateMap() { | ||
assertTrue(false); // Unreachable | ||
return null; | ||
} | ||
|
||
@Override | ||
protected void testRead() { | ||
final Map<String, Object> searchBody = new HashMap<>(); | ||
final String response = checkMethodBase(searchBody).get(API_PATH + "/" + LIST_ENDPOINT_SUFFIX).asString(); | ||
assertEquals(new Integer(0), JsonPath.from(response).get("response.status")); | ||
} | ||
|
||
@Override | ||
protected void tearDown() { | ||
// do nothing | ||
} | ||
|
||
@Test | ||
void crudTest() { | ||
testRead(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* | ||
* Copyright 2012-2018 CodeLibs Project and the Others. | ||
* | ||
* 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.codelibs.fess.it.admin; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.codelibs.fess.it.CrudTestBase; | ||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import io.restassured.path.json.JsonPath; | ||
|
||
@Tag("it") | ||
public class JobLogTests extends CrudTestBase { | ||
|
||
private static final String NAME_PREFIX = "joblogTest_"; | ||
private static final String API_PATH = "/api/admin/joblog"; | ||
private static final String LIST_ENDPOINT_SUFFIX = "logs"; | ||
private static final String ITEM_ENDPOINT_SUFFIX = "log"; | ||
|
||
private static final String KEY_PROPERTY = ""; | ||
|
||
@Override | ||
protected String getNamePrefix() { | ||
return NAME_PREFIX; | ||
} | ||
|
||
@Override | ||
protected String getApiPath() { | ||
return API_PATH; | ||
} | ||
|
||
@Override | ||
protected String getKeyProperty() { | ||
return KEY_PROPERTY; | ||
} | ||
|
||
@Override | ||
protected String getListEndpointSuffix() { | ||
return LIST_ENDPOINT_SUFFIX; | ||
} | ||
|
||
@Override | ||
protected String getItemEndpointSuffix() { | ||
return ITEM_ENDPOINT_SUFFIX; | ||
} | ||
|
||
@Override | ||
protected Map<String, Object> createTestParam(int id) { | ||
assertTrue(false); // Unreachable | ||
return null; | ||
} | ||
|
||
@Override | ||
protected Map<String, Object> getUpdateMap() { | ||
assertTrue(false); // Unreachable | ||
return null; | ||
} | ||
|
||
@Override | ||
protected void testRead() { | ||
final Map<String, Object> searchBody = new HashMap<>(); | ||
final String response = checkMethodBase(searchBody).get(API_PATH + "/" + LIST_ENDPOINT_SUFFIX).asString(); | ||
assertEquals(new Integer(0), JsonPath.from(response).get("response.status")); | ||
} | ||
|
||
@Override | ||
protected void tearDown() { | ||
// do nothing | ||
} | ||
|
||
@Test | ||
void crudTest() { | ||
testRead(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* | ||
* Copyright 2012-2018 CodeLibs Project and the Others. | ||
* | ||
* 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.codelibs.fess.it.admin; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.codelibs.fess.it.CrudTestBase; | ||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import io.restassured.path.json.JsonPath; | ||
|
||
@Tag("it") | ||
public class LogTests extends CrudTestBase { | ||
|
||
private static final String NAME_PREFIX = "logTest_"; | ||
private static final String API_PATH = "/api/admin/log"; | ||
private static final String LIST_ENDPOINT_SUFFIX = "files"; | ||
private static final String ITEM_ENDPOINT_SUFFIX = "file"; | ||
|
||
private static final String KEY_PROPERTY = ""; | ||
|
||
@Override | ||
protected String getNamePrefix() { | ||
return NAME_PREFIX; | ||
} | ||
|
||
@Override | ||
protected String getApiPath() { | ||
return API_PATH; | ||
} | ||
|
||
@Override | ||
protected String getKeyProperty() { | ||
return KEY_PROPERTY; | ||
} | ||
|
||
@Override | ||
protected String getListEndpointSuffix() { | ||
return LIST_ENDPOINT_SUFFIX; | ||
} | ||
|
||
@Override | ||
protected String getItemEndpointSuffix() { | ||
return ITEM_ENDPOINT_SUFFIX; | ||
} | ||
|
||
@Override | ||
protected Map<String, Object> createTestParam(int id) { | ||
assertTrue(false); // Unreachable | ||
return null; | ||
} | ||
|
||
@Override | ||
protected Map<String, Object> getUpdateMap() { | ||
assertTrue(false); // Unreachable | ||
return null; | ||
} | ||
|
||
@Override | ||
protected void testRead() { | ||
final Map<String, Object> searchBody = new HashMap<>(); | ||
final String response = checkMethodBase(searchBody).get(API_PATH + "/" + LIST_ENDPOINT_SUFFIX).asString(); | ||
assertEquals(new Integer(0), JsonPath.from(response).get("response.status")); | ||
} | ||
|
||
@Override | ||
protected void tearDown() { | ||
// do nothing | ||
} | ||
|
||
@Test | ||
void crudTest() { | ||
testRead(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters