Package slim3.demo.controller.upload

Source Code of slim3.demo.controller.upload.DeleteControllerTest

package slim3.demo.controller.upload;

import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;

import org.junit.Test;
import org.slim3.datastore.Datastore;
import org.slim3.tester.ControllerTestCase;

import slim3.demo.model.UploadedData;

public class DeleteControllerTest extends ControllerTestCase {

    @Test
    public void run() throws Exception {
        int count = Datastore.query(UploadedData.class).count();
        tester.param("key", Datastore.keyToString(Datastore
            .put(new UploadedData())));
        tester.start("/upload/delete");
        DeleteController controller = tester.getController();
        assertThat(controller, is(notNullValue()));
        assertThat(tester.isRedirect(), is(true));
        assertThat(tester.getDestinationPath(), is("/upload/"));
        assertThat(Datastore.query(UploadedData.class).count(), is(count));
    }
}
TOP

Related Classes of slim3.demo.controller.upload.DeleteControllerTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.