Skip to content

Commit de08b62

Browse files
committed
Improve ShapefileCommands zip test to make sure the correct files are actually in the zip file.
1 parent b0fbb58 commit de08b62

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/java/org/geoserver/shell/ShapefilesCommandsTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
import org.junit.Test;
77

88
import java.io.File;
9+
import java.util.List;
910

1011
import static com.xebialabs.restito.builder.stub.StubHttp.whenHttp;
1112
import static com.xebialabs.restito.builder.verify.VerifyHttp.verifyHttp;
1213
import static com.xebialabs.restito.semantics.Action.status;
1314
import static com.xebialabs.restito.semantics.Action.stringContent;
1415
import static com.xebialabs.restito.semantics.Condition.*;
16+
import static junit.framework.Assert.assertEquals;
1517
import static junit.framework.Assert.assertTrue;
1618

1719
public class ShapefilesCommandsTest extends BaseTest {
@@ -40,5 +42,12 @@ public void zipShapefile() throws Exception {
4042
File zipFile = File.createTempFile("points",".zip");
4143
boolean result = commands.zip(file, zipFile);
4244
assertTrue(result);
45+
List<String> names = getFileNamesFromZip(zipFile);
46+
assertEquals(5, names.size());
47+
assertTrue(names.contains("points.shp"));
48+
assertTrue(names.contains("points.dbf"));
49+
assertTrue(names.contains("points.prj"));
50+
assertTrue(names.contains("points.shx"));
51+
assertTrue(names.contains("points.fix"));
4352
}
4453
}

0 commit comments

Comments
 (0)